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
9
votes
3 answers

/dev/tty.Serial* Missing in MacOS 10.9 (Mavericks)

I'm not sure if this was as a result of a recent update to OSX 10.9, but for some reason, all the /dev/tty.Serial* and /dev/cu.Serial* targets are now missing, making serial communication with a connected USB device impossible, programatically. I…
Yuri Green
  • 91
  • 1
  • 1
  • 5
9
votes
3 answers

Printed length of a string in python

Is there any way to find (even a best guess) the "printed" length of a string in python? E.g. 'potaa\bto' is 8 characters in len but only 6 characters wide printed on a tty. Expected usage: s = 'potato\x1b[01;32mpotato\x1b[0;0mpotato' len(s) #…
wim
  • 338,267
  • 99
  • 616
  • 750
9
votes
2 answers

Redirecting AT commands to microcom command under Linux

in the BusyBox command for Linux exists the command microcom to communicate with a serial modem: BusyBox v1.13.2 (2012-05-10 17:13:08 CEST) multi-call binary Usage: microcom [-d DELAY] [-t TIMEOUT] [-s SPEED] [-X] TTY Copy bytes for stdin to TTY…
Alex
  • 41,580
  • 88
  • 260
  • 469
8
votes
5 answers

Make R (statistics package) wait for keyboard prompt when run within a bash script

I am using R to generate a series of plots within a loop, with the user hitting the enter key to indicate they have seen the plot and it is time to move on. These are interactive rotatable plots generated with the rgl package and therefore using…
Setjmp
  • 27,279
  • 27
  • 74
  • 92
8
votes
4 answers

rsync exits with the message "stdin is not a tty"

I want to use rsync to my remote server for which I have SSH access. I use the following command: rsync -e 'ssh -p 22222' -rtz --delete content_dir/ user@example.com:/home/user/public_html After entering the command, it asks for the password for…
8
votes
3 answers

Is it possible to detect if a writer is tty or not?

Bash has a 'magical behavior', if you type 'ls', usually you will get colorful output, but if you redirect the output to a file, the color codes are gone. How to achive this effect using Go. e.g. With the following…
xrfang
  • 1,754
  • 4
  • 18
  • 36
8
votes
2 answers

How to find reasons why an udev rule is not applied?

I added an udev rule to generate a separate link to a special tty device. I took the vendor and product id from lsusb: Bus 001 Device 016: ID abcd:1234 Foo Device The dmesg output for the device is: [ 369.384850] usb 1-1.1: new full-speed USB…
eDeviser
  • 1,605
  • 2
  • 17
  • 44
8
votes
2 answers

stty hupcl ixon ixoff

I'm seeing stty, not a typewritter messages on hpux (despite an interactive terminal check?), and am guessing that these are due to the stty lines in my .kshrc file: case $- in *i* ) stty hupcl ixon ixoff stty erase '^?' kill '^U' intr '^C'…
Peeter Joot
  • 7,848
  • 7
  • 48
  • 82
8
votes
0 answers

Gradle - how to run exec in tty?

For some few days I've got a little issue with Gradle. When I'am running Gradle build from tty (for example in iTerm with oh-my-zsh), in which I'am invoking some other console commands, I was expecting that all invoked processes will be running also…
dudududi
  • 93
  • 2
8
votes
2 answers

Disconnect and reconnect ttyUSB0 programmatically in Linux

Trying to solve this problem (ttyUSB0 that works properly than stop working after about 1hr)I'm thinking on if disconnecting and reconnecting the usb device could be a good fix. So, it is possibile to cut down power to the USB device and repower it…
JosephITA
  • 502
  • 2
  • 11
  • 21
8
votes
4 answers

How can I echo to /dev/tty?

Is there a way to send something like an "end of data" after executing echo "test" > /dev/tty1 in order to gain the "input cursor" back to "receiving" terminal (in this case tty1)? Screenshot: http://picload.org/image/acdwigg/tty.png
inselberg
  • 549
  • 3
  • 13
  • 27
8
votes
3 answers

How to create a pseudo-tty for reading output and writing to input

I am using fork() and execvp() to spawn a process that must believe it is connected to an interactive terminal for it to function properly. Once spawned, I want to capture all the output from the process, as well as be able to send input to the…
Ben Vitale
  • 1,754
  • 3
  • 17
  • 27
7
votes
2 answers

Python TTY Control

I guess I'm not clear on what what the function of the getty/agetty/mgetty programs are on a linux/unix machine. I can start a shell on a tty with something like this: TTY = '/dev/tty3' cpid = os.fork() if cpid == 0: os.closerange(0, 4) …
tMC
  • 18,105
  • 14
  • 62
  • 98
7
votes
3 answers

How to I detect whether a tty belonging to a gsm/3g-modem is a data or control port?

I'm currently writing a small tool for a linux router that sets up a wwan (gsm/3g) connection when I plug an appropriate modem into its USB port. When the device is plugged in several ttys are registered and I currently maintain a list of…
ccyx
  • 71
  • 1
  • 3
7
votes
2 answers

Is there a cross-platform way to check if stdout is being piped into another program in Rust?

I'd like to disable colors when the output is piped somewhere else than a terminal.
Narigo
  • 2,979
  • 3
  • 20
  • 31