Skip to main content

Questions tagged [stdin]

Standard input (stdin, file descriptor 0) is the input stream to a program.

stdin
0 votes
0 answers
49 views

How can I get this STDIN to work in GAS Assembler running on Linux?

I am new to Assembler and am currently reading a book about it by Jonathan Bartlett called 'Learn to Program with Assembly'. On pages 160-1 he gives the following sample program to demonstrate the use ...
16 votes
3 answers
17k views

How to setup Visual Studio Code stdin/stdout redirection for Python (debugger)?

I am using Visual Studio Code to debug my Python code. I want to redirect one text file in stdin and the output be written in another file. I can reach that by running python directly using the ...
4 votes
2 answers
381 views

How can I read a single line user input with Bun.js?

Bun.js has a useful native API to read periodical user input: const prompt = "Type something: "; process.stdout.write(prompt); for await (const line of console) { console.log(`You typed: ${...
0 votes
0 answers
35 views

Read a single char value to stdin without pressing enter on keybard in C in mac os [duplicate]

I am using mac os with xcode-select version 2406 I am trying to find a way to Read a char value to STDIN without pressing enter or return key on keyboard in C. I know on windows we have getch function ...
5 votes
7 answers
268 views

gawk hangs when using a regex for RS combined with reading a continuous stream from stdin

I'm streaming data using netcat and piping the output to gawk. Here is an example byte sequence that gawk will receive: =AAAA;=BBBB;;CCCC==DDDD; The data includes nearly any arbitrary characters, but ...
0 votes
0 answers
36 views

asio::stream_descriptor for async read from stdin in raw mode crashes

I want to poll stdin asynchronously for terminal keyboard events, hence the following /* class tui contains a member 'stdin_' of type 'asio::stream_descriptor', initialized as such : stdin_{...
0 votes
0 answers
17 views

Send SSH input when output string is detected on windows from python

My company requires a passcode when SSHing to a server: ssh myserver Enter a passcode or select one of the following options: Passcode: I want call SSH in the background from a GUI so want to detect ...
0 votes
1 answer
21 views

undetectable Dart-Input in Visual Code Studio

I made a script in in Visual Studio Code using Dart that grabs the user's input. The problem is, that if I enter something in the input line in vscode, which is located below the debug console and ...
0 votes
1 answer
51 views

Bash - Log timestamp of the moment data was received on stdin, coming from a pipe

I have an application that outputs to stdout from time to time - random intervals, random durations of outputting before going silent again. Its output (binary data) is captured into a file. I want to ...
0 votes
0 answers
53 views

Break the loop if stdin has value

I can not stop the loop if there is not a gap in data send via UART. If there is gap in data it listens to the command but does not read the UART data anymore. I would like to I read data on UART and ...
1 vote
1 answer
51 views

How do I read all keys pressed in nim since the last call to a function, without needing to press enter

I need to read keys from stdin without blocking, and without only recieving them when a newline is pressed. The way i would like it be formatted is a sequence, where each item is a keypress or ascii ...
2 votes
2 answers
1k views

Is there a way to get synchronous terminal input in Node.js

I have looked at similar questions on SO and I have an ongoing question about if it is possible to get synchronous input from the command line. I know about readline and process.stdin.on('readable', ....
204 votes
9 answers
67k views

How to trick an application into thinking its stdout is a terminal, not a pipe

I'm trying to do the opposite of "Detect if stdin is a terminal or pipe?". I'm running an application that's changing its output format because it detects a pipe on STDOUT, and I want it to think ...
0 votes
0 answers
36 views

How do I know when a program is waiting for an input and then give the input through Python?

Sorry, this might look very stupid but I have a console C++ program and I need to pass input through Python. It is unexpected when this C++ program waits for an input and so I hoped I could have done ...
-1 votes
1 answer
47 views

Wrapping os.Stdin with an io.TeeReader breaks the tty

Context: I am trying to write a small tool in Golang, which spawns a vim editor and tries to record all the keystrokes input by the user. package main import ( "bufio" "fmt&...

15 30 50 per page
1
2 3 4 5
262