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
660
votes
11 answers

How to enter in a Docker container already running with a new TTY

I have a container that is running the Apache service in the foreground. I would like to be able to access the container from another shell in order to "poke around" inside it and examine the files. At the moment, if I attach to the container, I am…
Programster
  • 12,242
  • 9
  • 49
  • 55
525
votes
30 answers

How to fix 'sudo: no tty present and no askpass program specified' error?

I am trying to compile some sources using a makefile. In the makefile there is a bunch of commands that need to be ran as sudo. When I compile the sources from a terminal all goes fine and the make is paused the first time a sudo command is ran…
feeling_lonely
  • 6,665
  • 4
  • 27
  • 53
395
votes
9 answers

Confused about Docker -t option to Allocate a pseudo-TTY

What exactly does this option do? I've been reading a lot on TTY and I'm still confused. I played around without having the -t and just -i and it seems like programs that expect user input throw an error without the -t. Why is it important for…
user1099123
  • 6,063
  • 5
  • 30
  • 35
304
votes
5 answers

What do pty and tty mean?

I noticed many mentions of pty and tty in some open source projects, could someone tell me what do they mean and what is the difference between them?
why
  • 23,923
  • 29
  • 97
  • 142
202
votes
6 answers

Why is printing to stdout so slow? Can it be sped up?

I've always been amazed/frustrated with how long it takes to simply output to the terminal with a print statement. After some recent painfully slow logging I decided to look into it and was quite surprised to find that almost all the time spent is…
Russ
  • 10,835
  • 12
  • 42
  • 57
126
votes
17 answers

docker error on windows : the input device is not a TTY. If you are using mintty, try prefixing the command with 'winpty'

After I run this docker run --rm -v "/c/users/vipul rao/documents/github/wappalyzer:/opt/wappalyzer" -it wappalyzer/dev I am getting the following error the input device is not a TTY. If you are using mintty, try prefixing the command with…
Vipul Rao
  • 1,495
  • 2
  • 10
  • 15
109
votes
1 answer

What's the difference between /dev/tty.* and /dev/cu.* on macOS?

Each serial device shows up twice in /dev, once as a tty.* and once as a cu.*. What is the cu.* device? How does it differ from the tty.* device? ls -l /dev/*.usbmodem621 Output: crw-rw-rw- 1 root wheel 11, 5 Dec 25 18:00…
Mark Harrison
  • 297,451
  • 125
  • 333
  • 465
48
votes
3 answers

Reading and writing to serial port in C on Linux

I'm trying to send/receive data over an USB Port using FTDI, so I need to handle serial communication using C/C++. I'm working on Linux (Ubuntu). Basically, I am connected to a device which is listening for incoming commands. I need to send those…
Lunatic999
  • 1,310
  • 1
  • 13
  • 18
42
votes
1 answer

Pretend to be a tty in bash for any command

Whenever I use grep, and I pipe it to an other program, the --color option is not respected. I know I could use --color=always, but It also comes up with some other commands that I would like to get the exact output of that command as the output I…
edi9999
  • 19,701
  • 13
  • 88
  • 127
41
votes
7 answers

Get terminal size in Go

How to get tty size with Golang? I am trying do this with executing stty size command, but I can't craft code right. package main import ( "os/exec" "fmt" "log" ) func main() { out, err := exec.Command("stty", "size").Output() …
Ilia Sidorenko
  • 2,157
  • 3
  • 26
  • 30
37
votes
4 answers

Can you fool isatty AND log stdout and stderr separately?

Problem So you want to log the stdout and stderr (separately) of a process or subprocess, without the output being different from what you'd see in the terminal if you weren't logging anything. Seems pretty simple no? Well unfortunately, it appears…
J.J
  • 3,459
  • 1
  • 29
  • 35
36
votes
2 answers

What does TTY mean in the unix ps command?

When I run PS one of the columns output is TTY. What does this mean? In particular, how does as value of "??" compare with "ttys000"? I ask because I have a Java program execute sort via ProcessBuilder, and when this program is run via my IDE…
Aaron Silverman
  • 22,070
  • 21
  • 83
  • 103
36
votes
2 answers

How to workaround "the input device is not a TTY" when using grunt-shell to invoke a script that calls docker run?

When issuing grunt shell:test, I'm getting warning "the input device is not a TTY" & don't want to have to use -f: $ grunt shell:test Running "shell:test" (shell) task the input device is not a TTY Warning: Command failed: /bin/sh -c ./run.sh npm…
Matthew Adams
  • 2,059
  • 2
  • 21
  • 31
33
votes
4 answers

How to toggle CR/LF in gnu screen?

I'm using screen to read the text from a serial console. The problem is the output seems to only have newline \n but not carriage return \r, so the display looks like this... Line1 Line2 Line3 I wonder if there is any patch to fix…
Patrick
  • 4,186
  • 9
  • 32
  • 45
32
votes
2 answers

How do *nix pseudo-terminals work ? What's the master/slave channel?

I want to write a simple, dumb, X terminal emulator in C on a Linux system. At first, I just thought I would have to popen a shell and display its output. I checked xterm and rxvt code, and it looks a bit more complicated. First, I have to open a…
aaptel
  • 323
  • 1
  • 3
  • 6
1
2 3
64 65