Skip to main content

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.

2 votes
1 answer
247 views

TTY line discipline echoing feature

I'm confused from the actual meaning of the echoing feature implemented in Linux TTY driver. As far as I know, a pseudo-terminal pair (PTY pair) consists of a PTY master, a PTY slave and a line ...
CarloC's user avatar
  • 385
2 votes
2 answers
86 views

Unable to write to self in graphical terminal session?

Essentially, I noticed I am unable to write to my user who is using gnome-terminal. tty returns /dev/pts/1, but I am unable to write there as root. Instead, it returns as follows: myuser@pegasus:/$ ...
Vesta Tian's user avatar
0 votes
0 answers
50 views

using ptys from shell

In earlier times I was able to open a pair of pseudo terminals /dev/ttyp9 and /dev/ptyp9. It was easy to do something like: $ cat /dev/ptyp9 and in another shell $ echo Hallo > /dev/ttyp9 But on my ...
Klaus's user avatar
  • 528
0 votes
1 answer
171 views

Where is the tty line discipline exactly "logically" located?

I recently started learning about Operating Systems and the linux kernel. I was interested in terminals, so I started there, however, I quickly ran into a problem. I wrote a slightly longer question, ...
Yakog's user avatar
  • 517
0 votes
1 answer
179 views

xterm seems to change its "home" key behaviour for emacs

In xterm, when I press the HOME key on my keyboard, it normally sends ^[[H but when I open emacs -nw, it changes to ^[OH; those are home and khome respectively. I figured out while trying to build my ...
Alex028502's user avatar
0 votes
2 answers
202 views

How can I connect a bash process to a tty _without_ using getty

I would have two serial usb devices connected to each other, /dev/ttyUSB1 and /dev/ttyUSB2. I would like to run /bin/bash connected to one end, so that I can attach to the other end using picocom and ...
Alex028502's user avatar
1 vote
1 answer
166 views

job control doesn't work when I create my own pty pair with socat

I am experimenting with understanding terminal emulators by looking at the different pieces of the puzzle. I am trying to start a pty pair and shell process with socat, and then connect to it with ...
Alex028502's user avatar
0 votes
1 answer
151 views

how to get file descriptors of PTY inside of a child?

https://man7.org/linux/man-pages/man7/pty.7.html in the "UNIX 98 pseudoterminals" it is said that ptsname can be used (and then open), but this function accepts file descriptor. i tried to ...
Michael Quad's user avatar
1 vote
1 answer
340 views

Pseudo-terminals control each other, how to get the return display

The problem is: my pseudo-terminal is /dev/pts/0, the target pseudo-terminal is /dev/pts/4, and I'm trying to get the target pseudo-terminal to print text using the echo text > /dev/pts/4 command. ...
xnl2d's user avatar
  • 27
2 votes
0 answers
943 views

How to suppress "Failed to set controlling terminal" warning in GDB when setting program to run on another terminal?

I'm using GDB to debug a program, and I want to direct its output to a different terminal than the one where GDB is running. Here's what I've been doing: Open a second terminal, check its device name ...
Sebastian Carlos's user avatar
0 votes
0 answers
270 views

How to reown a process?

when i run this script with a shortcut(sxhkd): #!/bin/sh MUSIC_DIR="$HOME/music" songs=$(ls "$MUSIC_DIR") filename=$( echo -e "random\n$songs" | dmenu -l 30 -i -p &...
grayhatter's user avatar
0 votes
1 answer
345 views

how can I make socat simulate unplugging a serial device

I have this test program import sys for line in sys.stdin: print(line.strip()) print("DONE") if I get it to print out lines from a real device (an FTDI) python3 demo.py < /dev/...
Alex028502's user avatar
0 votes
1 answer
171 views

Can I set up a serial terminal (RS-232) without a pty?

I have two computers that both have a RS-232 port on /dev/ttyS0 connect together with a null modem. I am trying to understand bit by bit how an external terminal worked in the old days, and how that ...
Alex028502's user avatar
2 votes
1 answer
3k views

trying to make my own shell handle ctrl+c properly

I am trying to understand how shells are set up so that the programs they are running receive the SIGINT when you press ctrl C but the shell doesn't, because when you are running bash, and run another ...
Alex028502's user avatar
0 votes
1 answer
677 views

How to determine the graphical tty in loginctl

Loginctl lists a lot of sessions, and I want programmatically to know which one is a graphical session (e.g. GNOME desktop). In the example below, I have a GNome desktop session open, an ssh ...
Eric Stdlib's user avatar

15 30 50 per page
1
2 3 4 5
9