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
14
votes
7 answers

linux - write commands from one terminal to another

I need to write commands from one terminal to another terminal. I tried these: echo -e "ls\n" > /proc/pid/fd/0 echo -e "ls\n" > /dev/pts/4 Which just prints the ls as output and doesn't execute. I tried these: chmod 777 /dev/tty4 ;echo "ls" >…
user1364700
  • 161
  • 1
  • 1
  • 4
13
votes
6 answers

Using netcat/cat in a background shell script (How to avoid Stopped (tty input)? )

Abstract: How to run an interactive task in background? Details: I am trying to run this simple script under ash shell (Busybox) as a background task. myscript.sh& However the script stops immediately... [1]+ Stopped (tty input) myscript.sh The…
LovelyVirus
  • 383
  • 1
  • 3
  • 9
13
votes
2 answers

How do I set an environment variable dynamically when using poetry shell?

When I activate a virtual environment via poetry shell, GPG signing gets messed up because $GPG_TTY is set for the parent shell. So every time I use poetry shell I have to do GPG_TTY=$(tty). Is there a way to do this automatically? Ideally I would…
willclarktech
  • 197
  • 1
  • 2
  • 11
13
votes
0 answers

What is the relationship between Xorg (or any X server) and /dev/tty7 in Linux?

I have a few questions about what it means when one says "the X server runs on /dev/tty7". I made a few guesses as to how it works, and I'm hoping someone can tell me whether the following statements are true or false. /dev/tty7 is usually the…
Brian Bi
  • 111,498
  • 10
  • 176
  • 312
12
votes
1 answer

apt-key command works on shell but fails on Dockerfile

The following command seems to work when running it in a shell apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF but fails when executed in a Dockerfile as follows: Warning: apt-key output…
pkaramol
  • 16,451
  • 43
  • 149
  • 324
12
votes
1 answer

How to know which device is connected in which /dev/ttyUSB port

I am using two Wavecom 16-port modems. When I attach the modems to my system, I am able to list of all the /dev/ttyUSB port names, but also I want to know, which modem is containing ports 0 to 16 and which one is containing ports 17 to 32? The…
Mayur
  • 311
  • 1
  • 4
  • 13
11
votes
2 answers

How to deal with "Pseudo-terminal will not be allocated because stdin is not a terminal."

ssh -t remotehost vim /tmp/x.txt I know that I can run a command like the above. But I would like to be able to run any local bash code in a remote machine. For this reason, I'd like to call the remote 'bash -s' so that can process any local bash…
user1424739
  • 11,937
  • 17
  • 63
  • 152
11
votes
2 answers

Why does the sys_read system call end when it detects a new line?

I'm a beginner in assembly (using nasm). I'm learning assembly through a college course. I'm trying to understand the behavior of the sys_read linux system call when it's invoked. Specifically, sys_read stops when it reads a new line or line feed.…
Mercado
  • 606
  • 6
  • 20
11
votes
2 answers

Detect if stdin is a tty device (terminal) or pipe in PHP?

I wrote a php script. I want it show help message when called with standard input connected to a tty device (terminal) before reading and executing interactively, but dont show when called with a file or stream from pipe as standard input. Is there…
Cofyc
  • 185
  • 3
  • 10
11
votes
2 answers

How can I send terminal escape sequences through SSH with Go?

I'm writing a Go program that will connect to a host via SSH using the native x/crypto/ssh library and drop an interative shell. I'm using RequestPty(), but the (bash) shell on the remote end does not behave as expected with control codes. When I…
Cera
  • 1,879
  • 2
  • 20
  • 29
11
votes
2 answers

Terminal messed up (not displaying new lines) after running Python script

I have a Python script I use to execute commands in parallel across multiple hosts using the Python subprocess module. It wraps SSH, and basically makes a call like this: output = subprocess.Popen(["/bin/env", env, "/usr/bin/ssh", "-t", "%s@%s" %…
blindsnowmobile
  • 3,868
  • 6
  • 32
  • 47
11
votes
1 answer

JSCH sudo su command "tty" error

Java - Jsch sudo command. I am using Jsch and my task is to login to server and run command as following sudo su - bumboo Using following code i am successfully able to connect but when i try to run command it gives me error sudo: sorry, you must…
d-man
  • 57,473
  • 85
  • 212
  • 296
10
votes
1 answer

Psuedo-tty allocation in docker-compose

In docker, I can simply use the -t switch to have docker run allocate a pseudo-tty (in these examples I'm using nohup to detach from my real tty): $ nohup docker run debian tty # Produces "not a tty" $ nohub docker run -t debian tty #…
Spiros
  • 2,156
  • 2
  • 23
  • 42
10
votes
1 answer

Determine terminal/TTY background color at runtime

Using the chalk library to stylize/colorize the terminal. import chalk from 'chalk'; if I use: console.log(chalk.blue('foobar')); that's totally readable in a terminal with a light background, but totally unreadable in a terminal with a dark…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
10
votes
1 answer

What is the relationship between framebuffer, VT, and tty?

I'm now studying what is the mechanism behind Ctrl+Alt+F1~F7. I found some infomation talk about framebuffer, VT, and tty. I know framebuffer is an anstraction to graphic card manipulation and tty(and pts) is something a program interact with. I…
Jisa
  • 101
  • 1
  • 4