3,934 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
0
answers
39
views
How to enable echo in Terminal.readLine (Effect)?
I want to make a minimal interactive console utility using Effect.
Started from an empty Effect app:
npx create-effect-app@latest
... (interactive part)
cd effect-app
npm install
Then I copy-pasted ...
1
vote
1
answer
64
views
SSH-bound Go CLI Daemon – SSH Connects Successfully, but No Input Accepted
I'm building a custom CLI daemon in Go for Ubuntu.
When I run the CLI locally (without SSH), everything works correctly — for example:
admin@admin> whoami
responds as expected.
However, after ...
0
votes
0
answers
25
views
Is it possible to configure expect to not close stdout when stdin is closed?
Consider the following expect script:
#!/usr/bin/env expect -f
send "Hello world"
expect eof
send "Goodbye world"
I would like the output to be Hello world followed by Goodbye ...
3
votes
1
answer
257
views
why can i only use read() but not fread?
Consider the following code:
#include <iostream>
#include <string>
#include <termios.h>
#include <unistd.h>
void settings() {
struct termios settings;
settings.c_lflag ...
3
votes
0
answers
150
views
How to immediately stop `io.Copy(os.Stdin, stream)` when stream is closed in Go?
I’m trying to forward input from os.Stdin to a network stream in Go like this:
go func() {
for {
if _, err := io.Copy(stream, os.Stdin); err != nil {
log.Error(err)
...
0
votes
5
answers
160
views
Handling of quitting the pipe / stdin on linux when no input received
Say I have an image viewer program. I would want to view images in these two ways:
imageviewer [list of files] // scenario A
[list of files] | imageviewer // scenario B
and using one method shall not ...
1
vote
2
answers
149
views
How does one read from stdin with a timeout in python?
I'm trying to read from stdin and get None (or some other defined value) should the user not input any text after a predefined timeout. However, when I tried the below code, the script just hung ...
0
votes
0
answers
42
views
Python NetExtender CLI
I'm attempting to build a script that I can use to connect to my SonicWall NetExtender VPN via Python.
Currently my connect method successfully triggers the OTP password to be sent to my email.
def ...
0
votes
3
answers
116
views
Is this way of getting a formated input from stdin better than default scanf?
#include <stdio.h>
#include <stdlib.h>
#define BUF_SIZE 1024
int main() {
char *buf = (char*)malloc(BUF_SIZE*sizeof(char));
fgets(buf, BUF_SIZE, stdin);
int a = 0;
sscanf(buf, ...
2
votes
0
answers
77
views
Why is a background process receiving a POLLIN event on stdin?
I have a program that polls on a set of file descriptors, including stdin, to read and write from them. I also have a set of scripts that do things like run the program in the background for testing. ...
3
votes
0
answers
139
views
OpenMPI 5.0.7 problem in reading from stdin
I am trying to parallelize a program that reads a huge file from the stdin using OpenMPI. The problem is that the input is not correctly read. More specifically, when the OpenMPI runtime is ...
1
vote
2
answers
114
views
Still receiving Invalid Argument Errno::EINVAL with STDIN.gets.chomp and $stdin.gets.chomp - Windows 10
I've never written or read any ruby code in my life until today - this said - I've been tasked with solving an input problem. In the short amount of reading I've done, I've found that @vars are ...
3
votes
1
answer
95
views
Python script with input() and print() do not print when run from PowerShell class method
This script in question runs as expected from powershell:
# scripts.py
x = input("type your input: ")
print(f"your input is: {x}")
But once you wrap it into a module:
class CSV{
...
-1
votes
1
answer
88
views
(windows) how to pipe a command and use stdout as arguments for the next command instead of stdin
There are two main commands im using, ripgrep and gawk(awk version for windows). Im on the cmd, so i cant really use $( )
Basically i use ripgrep to find a patter in a list of markdown files:
rg --...
3
votes
2
answers
232
views
How to detect stdin input in a cancel-safe way in Rust async?
Problem
I'm working with asynchronous code in Rust and trying to handle user input from stdin in a cancel-safe manner. My goal is to be able to detect when a user presses a key (or hits enter) to ...