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
19
votes
2 answers

How to detect if Node's process.stdout is being piped?

Is there any way I can detect if the output from my Node.js script is being piped to something other then the terminal? I would like some way of detecting if this is happening: node myscript.js | less Or if this is happening: node myscript.js
iamsim.me
  • 560
  • 4
  • 17
19
votes
7 answers

How to display tabs as 4 spaces in gnome-terminal

Actually gnome-terminal display tabs as 8 spaces, and this is very annoying when you cat files or view diffs, is there some way to change this permanently?
Htechno
  • 5,901
  • 4
  • 27
  • 37
19
votes
1 answer

How to switch linux kernel console after boot process?

On my embedded system I usually use /dev/ttyS0 as a main console. This is achieved by passing kernel parameter console=/dev/ttyS0 and when init takes its part, getty is fired on the same device as specified in inittab by eg.…
Honza
  • 1,734
  • 3
  • 16
  • 22
19
votes
4 answers

Leaving tmux scrollback in terminal (iTerm2)

Usually tmux will only show as much output as however many rows my terminal currently displays. And then when I detach it, it clears all of its content. I know how to look at scrollback (ctrl+A, [, k, ...), but how can I configure tmux to just print…
chbrown
  • 11,865
  • 2
  • 52
  • 60
18
votes
3 answers

Why do I have to type ctrl-d twice?

For my own amusement, I've cooked up a python script that allows me to use python for bash one-liners; Supply a python generator expression; and the script iterates over it. Here's the script: DEFAULT_MODULES = ['os', 're', 'sys'] _g = {} for m in…
SingleNegationElimination
  • 151,563
  • 33
  • 264
  • 304
16
votes
1 answer

docker-compose exec python the input device is not a TTY in AWS EC2 UserData

I am using EC2 UserData to bootstrap the instance. TRacking log of bootstrap execution /var/log/cloud-init-output.log, I found that the script was stopped at : + docker-compose exec web python /var/www/flask/app/db_fixtures.py the input device is…
Abdennour TOUMI
  • 87,526
  • 38
  • 249
  • 254
16
votes
1 answer

How do I completely disable bell in screen (both visual and audio)

In screen, is there a way to completely disable bell ? I know you can switch to audio bell instead of the visual one and have already done that and have also specified no bell in putty so I don't hear anything but whenever there is a bell in one…
L Lawliet
  • 2,565
  • 4
  • 26
  • 35
16
votes
3 answers

Why does ssh wait for my subshells without -t, and kill them with -t?

I have a bash script start.sh which looks like this: for thing in foo bar; do { background_processor $thing cleanup_on_exit $thing } & done This does what I want: I run start.sh, it exits with code 0, and the two subshells…
gubbins
  • 581
  • 4
  • 12
15
votes
1 answer

Write program that pretends to be a TTY

I'm writing a program that reads input from stdin, manipulates the input, and writes output to stdout. However, many programs check whether stdin is a terminal or a pipe (by calling a function like isatty), and generate output differently. How do I…
Ethan
  • 18,584
  • 15
  • 51
  • 72
15
votes
4 answers

Spawning a child process with tty in node.js

I am trying to do some work on a remote server using ssh--and ssh is called on the local machine from node.js A stripped down version of the script looks like this: var execSync = require("child_process").execSync; var command = 'ssh -qt…
user1739757
15
votes
2 answers

How can I find which physical device /dev/console connects to?

There is a device file called /dev/console, whose (major,minor) is (5,1). When I boot with a serial console, it connects to my UART port as /dev/ttyS0 does. But when I boot with serial console disabled, the /dev/console seems to connect to…
user1937358
  • 239
  • 1
  • 2
  • 8
15
votes
3 answers

Mac OS analog to /dev/ttyUSBxx

I used to linux USB port naming, aka /dev/ttyUSBxx and currently trying to write some test software to read/write raw data to USB ports on iMac, but i find it hard to detect to which port my usb hardware is connected. I have tried up to a using…
edelmaks
  • 193
  • 1
  • 1
  • 10
15
votes
5 answers

How can I implement timeout for read() when reading from a serial port (C/C++)

I am reading bytes from a serial port in C++ using a file descriptor and the posix/unix read() function. In this example, I am reading 1 byte from the serial port (baud rate settings and similiar are omitted for clarity): #include…
pvh1987
  • 621
  • 5
  • 8
  • 12
14
votes
3 answers

'screen /dev/ttyUSB0' with different options such as databit, parity, etc

I am trying to use screen /dev/ttyUSB0 to connect to a old computer(s) through a USB-serial interface. I have not figured out to put the correct options in my command line to get a non-gibberish feedback from my computer (the text received is all…
14
votes
3 answers

Python in Emacs shell-mode turns on stty echo and breaks C-d

When I run an interactive Python inside an Emacs shell buffer (M-x shell), it does two surprising things to the TTY. First, it turns on input echo, which persists after Python exits, until I do stty -echo. Secondly, it doesn't accept C-d (or C-q…
Nick Barnes
  • 191
  • 8
1 2
3
64 65