Questions tagged [pty]

Pseudoterminals (also spelled “pseudotty” or “PTY”) are pseudo-devices used with ttys whose emulators run in userspace. Use the [tty] tag for broad (text terminal)-related questions, and the [console] tag for terminal devices pertaining to the system console.

22 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
1k views

Socat open TCP only when PTY opened

I am trying to link a virtual PTY with a remote device which accepts TCP connections on port 23. The opening and closing of the socket on the target device is a significant event and part of the ...
4
votes
2answers
1k views

Bash shell launched by forkpty() spawns child processes that ignore SIGINT. Why and how do I ensure SIGINT is not ignored?

I have a C program that uses forkpty to execute a bash shell. I'm finding that the programs launched by this shell are launched with SIGINT ignored, so when I send a Ctrl-C to the shell they never ...
3
votes
1answer
579 views

What exactly tty line discipline does with input from pty slave device?

I know that tty line discipline processes special characters (such as ^C, ^? and etc), but it is only about input from pty master device. But what about input from pty slave device? What tty line ...
3
votes
0answers
84 views

Can terminal parameter changes on the slave side be detected on master?

A process (creator) creates a pseudo-terminal master/slave[/dev/pts/1] pair. Another process (consumer) opens /dev/pts/1 and changes the serial terminal parameters with tcsetattr. Is there a way for ...
2
votes
0answers
338 views

Opening character device for reading in parallel by multiple processes on Linux

I would like to open a character device e.g. /dev/tty1 by multiple processes in a way that would not interfere reads between them. I noticed that if one process consumes a byte, no other process would ...
2
votes
0answers
706 views

Setting up Linux Bluetooth 4.0 serial port - gatttool/socat?

Bluetooth LE/ 4 is different from traditional Bluetooth serial port profiles and old instructions don't work. Bluetooth LE is basically all user mode, and there are some instructions on accessing LE ...
1
vote
0answers
433 views

PTY allocation request failed on channel 0

My remote vm server's password has expired, i cann't change password. [user@localhost ~]$ ssh root@x.x.x.x root@x.x.x.x's password: PTY allocation request failed on channel 0 WARNING: Your password ...
1
vote
1answer
131 views

Using shared serial modem

I'm trying to use on Solaris box modem connected to Linux box via serial port. Sharing is made from socat. Server command(linux): socat tcp-l:54321,reuseaddr,fork file:/dev/ttyXXX0,nonblock,...
0
votes
1answer
43 views

Why is Linux giving a pts number for real terminal console? (which is not an emulated terminal like ssh or xterm)

I read that pts is a pseudo-terminal (that we get through ssh or xterm) and tty is the native terminal. I didn't connect to my PC through ssh or xterm, but I am still getting pts/0 and pts/1 when I ...
0
votes
0answers
53 views

Interpret bash escape sequences and other characters using ncurses

I want to design a terminal multiplexer like tmux, but not that complex, something minimal, that works remote, using ncurses. On the server side, the workflow is as follows: The server process ...
0
votes
0answers
9 views

tty specification / unit tests

I'm trying to write my own tty system for a Javascript-based operating system. I found a useful high-level overview of the tty here: What are the responsibilities of each Pseudo-Terminal (PTY) ...
0
votes
0answers
33 views

Data written to PTY master is not visible at PTY slave

I'm working on an embedded system using UART. There is a driver which reads from a UART device and writes to a PTY and an application which reads from the PTY. I need to use the PTY as not all ...
0
votes
0answers
47 views

Prevent SSH from echoing STDIN when forcing pseudo-TTY

I'm running a command like this: ssh -tt server "/bin/bash -c \"trap 'kill -HUP 0' EXIT && awk '{print; exit}' > test.txt && ./test.sh\"" <<< "TEST&...
0
votes
1answer
34 views

script -c '…' does NOT print colors

edit: I was in EternalTerminal session, and that was the source of the difference. In a regular ssh, it works. I need to get commands in a pipe to believe they are in a PTY and emit colorized output. ...
0
votes
0answers
377 views

Link character device to pty with socat

I have a "regular character device" - not sure of the proper naming - that doesn't support ioctl on an embedded device (/dev/appvcom). I need to connect to it with an application that uses some ioctl ...
0
votes
0answers
293 views

Why does changing my home directory in WSL break my PATH but only in the second window in tmux?

A bit ago, I found it necessary to set my home directory to my One Drive in WSL. Thanks to this post I was even able to get my permissions working correctly within WSL (Ubuntu 16.04 LTS). However, ...
0
votes
0answers
280 views

Restricted shell within docker container

Some context for my question: I am working on a pty NodeJS server running in docker where I want to provide users connecting to the shell an isolated environment where they can play around with ...
0
votes
0answers
35 views

Why does macOS specific terminal shortcuts like Left-arrow + Option work in a remote shell on Ubuntu with a dedicated pty?

Why do macOS specific terminal shortcuts like Left-arrow + Option work in a remote shell on Ubuntu with a dedicated pty? I'm trying to understand why macOS specific terminal shortcuts like Left-arrow ...
0
votes
0answers
220 views

Why does ssh allocate a tty on server side?

Basically when you run an interactive program on the server you need to use ssh -t instead of ssh. For example: This works: ssh -t user@server top. This doesn't work: ssh user@server top. Question ...
0
votes
1answer
239 views

Is it possible to use a pseudoterminal to redirect PPP’s dataflow to an application?

I want to set PPP in order to use a pseudoterminal slave (/dev/pts/N) instead of a physical serial link, handle its data flow in an application (from /dev/ptmx) and redirect that flow … somewhere ...
0
votes
1answer
262 views

Find unused pseudoterminal pair in systemd service?

Application for which I'm writing service file expects its STDIN to be connected to the tty, or in other words to be run on the terminal. Systemd has the following settings which do the trick for my ...
0
votes
1answer
62 views

How can I automatically interrupt what I'm doing to input something?

As per Nick Winter's The Motivation Hacker, I want to measure my happiness. I know that I'm bad at remembering things or responding to reminders, so I'd like to set up a daemon that, at random ...