Questions tagged [tty]

For questions related to terminal drivers and the behaviour of terminals for Unix and related systems.

The tag should be used for questions related to terminal drivers and the behaviour of terminals for Unix and related systems (Linux, BSD, Solaris, AIX, HP-UX, MacOS X, etc). Sometimes, this is related to or or .

Example questions:

972 questions
32
votes
3 answers

Run interactive Bash with popen and a dedicated TTY Python

I need to run an interactive Bash instance in a separated process in Python with it's own dedicated TTY (I can't use pexpect). I used this code snippet I commonly see used in similar programs: master, slave = pty.openpty() p =…
TKKS
  • 513
  • 1
  • 4
  • 9
31
votes
2 answers

How to write data to existing process's STDIN from external process?

I'm seeking for ways to write data to the existing process's STDIN from external processes, and found similar question How do you stream data into the STDIN of a program from different local/remote processes in Python? in stackoverlow. In that…
mooz
  • 325
  • 1
  • 3
  • 7
30
votes
5 answers

PHP CLI: How to read a single character of input from the TTY (without waiting for the enter key)?

I want to read a single character at-a-time from the command line in PHP, however it seems as though there is some kind of input buffering from somewhere preventing this. Consider this code: #!/usr/bin/php
dansimau
  • 1,155
  • 1
  • 8
  • 11
30
votes
4 answers

How to start GNOME Wayland session from command line/tty?

I'm experimenting with wayland. You can start Gnome with X through startx command. Is there an way to start Gnome with wayland through some command? I would like to be able to run Gnome/X on my main display. Then switch to display :2…
Leo Ufimtsev
  • 6,240
  • 5
  • 40
  • 48
26
votes
2 answers

Piping data to Linux program which expects a TTY (terminal)

I have a program in Linux which refuses to run if its stdin/stdout is not a TTY (terminal device). Is there an easy-to-use tool which will create a PTY, start the program with the newly created TTY, and copy all data over stdin/stdout? The use case…
pts
  • 80,836
  • 20
  • 110
  • 183
26
votes
3 answers

Run command and get its stdout, stderr separately in near real time like in a terminal

I am trying to find a way in Python to run other programs in such a way that: The stdout and stderr of the program being run can be logged separately. The stdout and stderr of the program being run can be viewed in near-real time, such that if the…
J.J
  • 3,459
  • 1
  • 29
  • 35
25
votes
3 answers

Receiving key press and key release events in Linux terminal applications

I would like to write a simple C program that will perform different actions based on both "key down" and "key up" events. This program will be run from inside rxvt. What library or mechanism should I use to access both key presses and releases? Is…
keypressandrelease
22
votes
3 answers

Why does running a background task over ssh fail if a pseudo-tty is allocated?

I've recently run into some slightly odd behaviour when running commands over ssh. I would be interested to hear any explanations for the behaviour below. Running ssh localhost 'touch foobar &' creates a file called foobar as expected: [bob@server…
22
votes
2 answers

Cannot disable systemd serial-getty service

On Raspberry Pi with Arch Linux there is a service active called serial-getty@AMA0. The unit file is: /usr/lib/systemd/system/serial-getty@.service As root I can invoke systemctl stop serial-getty@ttyAMA0 systemctl disable serial-getty@ttyAMA0 But…
lojoe
  • 521
  • 1
  • 3
  • 13
21
votes
3 answers

TTY switch for Ctrl-Alt F1 and Alt-F1...F6 in Mac OS X

Is it possible... to have a terminal mode for the keybinding Ctrl+Alt+F1 to switch between TTYs for Alt+F1...F6 Ubuntu has the above commands to move between different TTYs. It seems that Mac does not have them activated. How can you activate the…
Léo Léopold Hertz 준영
  • 134,464
  • 179
  • 445
  • 697
21
votes
5 answers

kubectl attach: Unable to use a TTY - container es-node did not allocate one

I am trying to attach to a running container in Kubernetes, however I get the error message below. >kubectl attach -it es-client-2756725635-4rk43 -c es-node Unable to use a TTY - container es-node did not allocate one If you don't see a command…
speedplane
  • 15,673
  • 16
  • 86
  • 138
19
votes
4 answers

How to reroute stdout, stderr back to /dev/tty

I just ssh-ed to some remote server and found that stdout and stderr of all commands/processes I am trying to run in bash is redirected to somewhere. So, I got following questions How to detect: 1) Which file stdout, stderr is beeing rerouted in…
Sergey
  • 785
  • 1
  • 5
  • 14
19
votes
1 answer

What is the purpose of the "-i" and "-t" options for the "docker exec" command?

To be honest, I have always been confused about docker exec -it …, docker exec -i … and docker exec -t …, so I decide to do a test: docker exec -it …: # docker exec -it 115c89122e72 bash root@115c89122e72:/# ls bin boot dev etc home lib …
Nan Xiao
  • 16,671
  • 18
  • 103
  • 164
19
votes
2 answers

How do I detect if stdout is connected to a tty in Perl?

I'm looking for the Perl equivalent to this Python code: from sys import stdout if stdout.isatty(): print "yes" else: print "no"
bukzor
  • 37,539
  • 11
  • 77
  • 111
19
votes
8 answers

Vagrant is attempting to interface with the UI in a way that requires a TTY

Problem: vagrant up fails with the error below. I am running vagrant on Windows 7 and the base box is Ubuntu )( files.vagrantup.com/precise32.box ). how can it be fixed? vagrant.bat up Bringing machine 'default' up with 'virtualbox'…
sl5
  • 191
  • 1
  • 1
  • 4
1
2
3
64 65