441 questions
3
votes
1
answer
67
views
Make a Python process that communicates with itself over a PTY
I'm attempting to write tests using Pytest for an application that, among other things, checks to see if its standard input is connected to a terminal and changes its behavior if so. The application ...
1
vote
0
answers
222
views
Is it possible to set stdin of a process to a pipe and the rest to a TTY device?
I am trying to spawn a process so that I can do the following:
Send text to its standard input and specify EOF by closing the stdin pipe.
Connect the process' stdout and stderr to a TTY device so ...
1
vote
1
answer
114
views
Why are Grep highlight sequences not read with `pty`?
I was experimenting with creack/pty while learning about pseudo terminals.
I spawned grep and hooked it up with a pseudo terminal device as follows:
package main
import (
"fmt"
&...
2
votes
1
answer
131
views
Tauri + expectrl PTY: interactive CLI freezes when waiting for input (read thread holds mutex) — how to do concurrent read/write safely?
Background
Tauri v2 desktop app (macOS, Apple Silicon) with React + xterm.js frontend.
Rust backend spawns local CLI “agents” (Codex / Gemini) in a PTY using expectrl 0.7.1, forwards output to the ...
2
votes
1
answer
170
views
How to have a parent terminal view and pilot a child pseudo-terminal
Goal: In Python have a parent terminal start a program in a child pseudo-terminal (PTY), see its outputs and provide its inputs. At any given time, the parent terminal should be able to query what's ...
1
vote
0
answers
269
views
Error during npm install of node-pty: MSB8040 Spectre-mitigated libraries required
I'm encountering an error while trying to install the node-pty package using npm. I followed the standard installation process, but I ran into an issue during the build phase that involves node-gyp.
...
1
vote
1
answer
122
views
How to implement ssh session logging in Go?
I am writing a simple bastion service which will log input/output of a ssh session. The ssh connection part looks like:
func connect(user, host string, logger sessionLogger) error {
cmd := exec....
0
votes
0
answers
27
views
Python flask_socketio + pty recieve handler not being called
So, I have some code for a flask_socketio virtual console. I can see the output, but when to send in a command, recv isn't called.
Code:
@socketio.on('connect')
def test_connect(auth: str):
def ...
1
vote
0
answers
61
views
Why does writing to a PTY master trigger an input event when no slave is attached but not when picocom is running?
I’m working on a Linux application where I interact with a pseudo-terminal (PTY). Specifically, I’ve implemented the following:
I create a PTY slave and monitor writes and reads on the PTY master ...
0
votes
0
answers
935
views
Use Python interact with an interactive Bash session using the pty module
In (Debian) Linux I'd like to start an interactive Bash session and then pass it commands.
With my attempt it seems Bash isn't behaving as it would in a real terminal and abruptly stops during ...
5
votes
1
answer
279
views
What is lseek of a tty on macOS doing?
Consider the following C program, named weird.c (because the thing it is doing makes no sense):
#include <inttypes.h>
#include <stdint.h>
#include <stdio.h>
#include <unistd.h>
...
1
vote
1
answer
141
views
Trying to force run `su' in a pty
I have a shell, where I switch to another user with su -l anotheruser, this mostly works
But when there is no pty allocated to su, it errors out with:
su: must be run from a terminal
So, I tried to ...
1
vote
0
answers
64
views
Python ptyprocess does not read last two lines
I can see what's happening in the real terminal with "OK" in the end of the response.
But the read method does not return the last two lines.
@staticmethod
def communicate(...
1
vote
1
answer
237
views
third param for ioctl in Perl
Background: I'm trying to create a pseudo-terminal using only the tools that come with "Git for windows" so please don't tell me "just install tool XYZ" if XYZ requires extra ...
0
votes
0
answers
89
views
How to determine if a pseudo console is waiting for user input?
The pseudo console in question is created using winapi::um::consoleapi::CreatePseudoConsole
I've tried determining if its waiting for input by scraping the output. But.. that is unreliable, to say the ...