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
6
votes
1 answer

Golang reading from stdin, how to detect special keys (enter, backspace... etc)

I have the following program that reads user input from stdin: var input string = "" exec.Command("stty", "-F", "/dev/tty", "cbreak", "min", "1").Run() exec.Command("stty", "-F", "/dev/tty", "-echo").Run() var b…
George H
  • 412
  • 3
  • 6
  • 12
6
votes
1 answer

What possible reasons could block a virtual terminal on Linux?

Or is it possible at all that some process or something else could block a virtual terminal? Or what could be a reason that an application hangs when trying to access the VT1? It seems, while that is happening, it is hanging in the function ioctl.…
Albert
  • 65,406
  • 61
  • 242
  • 386
6
votes
1 answer

Why is terminfo[kcuu1] = '\EOA'?

From what I can tell reading terminfo(5), kcuu1 should be the sequence that the terminal sends when the up arrow is pressed. I have never, ever seen that be anything other than ^[[A (speaking now about cat, messed up terminal settings, etc). So,…
Steve McKay
  • 2,123
  • 17
  • 26
6
votes
3 answers

Linux: can I read the output of another process without using any IPC (pipes, etc.)?

Is it possible in linux to somehow read the output (from stdout and stderr) of another process without it knowing about it? So lets say I have a process A running in the background and process B wants to read its output - is it possible? I can't use…
zbigh
  • 457
  • 2
  • 9
  • 16
6
votes
4 answers

Catching a direct redirect to /dev/tty

I'm working on an application controller for a program that is spitting text directly to /dev/tty. This is a production application controller that must be able to catch all text going to the terminal. Generally, this isn't a problem. We simply…
daniel
  • 2,568
  • 24
  • 32
6
votes
1 answer

How do I run an Envoy Task with a tty?

I'm using Laravel's Envoy library for deployment. When I get to the end of deployment, I need to change a bunch of files' ownership; in order to do this, I need to switch to the root user, because chown and chmod don't work as an unprivileged…
Goldentoa11
  • 1,700
  • 2
  • 17
  • 29
6
votes
3 answers

running mkdir through php using shell script not working

I have created a file test.sh which looks like this: #!/bin/sh mkdir /testDir If I run the script on the command line like: sudo /path/to/test.sh it successfully creates the directory. I have added the sudo permissions like this in the…
maxisme
  • 3,974
  • 9
  • 47
  • 97
6
votes
5 answers

Correct initialization sequence for Linux serial port

I wrote an application that must use serial ports on Linux, especially ttyUSB ones. Reading and writing operations are performed with standard select()/read() loop and write(), and there is probably nothing wrong in them, but initialization code (or…
Catherine
  • 22,492
  • 3
  • 32
  • 47
6
votes
0 answers

GDB: Failed to set controlling terminal

I found some questions about this warning but all related to IDEs. This is for pure terminal GDB interaction. Using GDB tty command, I get the warning and further interaction with program is impossible. In terminal 1, I get its TTY for GDB t1~$…
Ions
  • 71
  • 1
  • 3
6
votes
2 answers

Writing a Linux Terminal emulator

I'd like to write a x11 terminal emulator, but I don't know how I should spawn and communicate with the shell, is there any basic (pseudo- or C) code for that? like what sort of PTY to create, how to bind the shell to it, what signals I have to…
nonchip
  • 1,084
  • 1
  • 18
  • 36
6
votes
2 answers

Terminfo smkx and Application Cursor Keys vs Application keypad

XTerm Control Sequences specifies the following key sequences: CSI ? 1 h → Application Cursor Keys (DECCKM) CSI ? 1 l → Normal Cursor Mode (DECOM) CSI ? 66 h → Application keypad (DECNKM) CSI ? 66 l → Numeric keypad (DECNKM) and the Terminfo…
fornwall
  • 2,877
  • 3
  • 25
  • 38
6
votes
1 answer

Managing serial port names in Mac OSX with symlinks

I'm wondering if someone knows a way to manage USB serial port names in OSX? For example, whenever I connect a specific device serial number I always want it's serial /dev/device1 I know in linux you can do this by…
Michael
  • 1,577
  • 1
  • 18
  • 33
6
votes
2 answers

Screen "Must be connected to a Terminal."

I'm on a Debian OS. I'm trying to use screen under a SSH session. But when I'm trying to run the command screen the shell answer me : Must be connected to a Terminal. If I enter tty it answer me : Not a tty I don't know why and I try ssh -t…
BaptisteL
  • 113
  • 1
  • 1
  • 8
6
votes
2 answers

What's the opposite of \b character, i.e. a kind of non-erasing space?

The \b control character, as I understand it, is not supposed to erase the previous character (this would be \b + a del character as well), so something like this works: >>> print 'pototo\b\b\ba' potato Is there a character for moving forwards,…
wim
  • 338,267
  • 99
  • 616
  • 750
6
votes
2 answers

What is a TTY and how can I enable it on Ubuntu?

I'm currently setting up a node.js server and I'm using the debug module here https://github.com/visionmedia/debug. I'm trying to enable it so I can get the colored debugging information in my output, however my terminal looks like the last terminal…
Robeezy
  • 2,424
  • 3
  • 22
  • 28