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

Docker ubuntu cron tail logs not visible

Trying to run a docker container that has a cron scheduling. However I cannot make it output logs. Im using docker-compose. docker-compose.yml --- version: '3' services: cron: build: context: cron/ container_name:…
Robbo_UK
  • 11,351
  • 25
  • 81
  • 117
7
votes
7 answers

How can I spy on communication between a process and a terminal?

I have a Linux process developed by a third-party that communicates with a terminal. For debugging I want to see the communication going back in forth. One might think cat would do the trick (to see one direction): ./third-party-app & cat…
jbarlow
  • 1,500
  • 14
  • 21
7
votes
4 answers

How to run command during Docker build which requires a tty?

I have some script I need to run during a Docker build which requires a tty (which Docker does not provide during a build). Under the hood the script uses the read command. With a tty, I can do things like (echo yes; echo no) | myscript.sh. Without…
marius
  • 1,352
  • 1
  • 13
  • 29
7
votes
3 answers

How do i read single character input from keyboard using nasm (assembly) under ubuntu?

I'm using nasm under ubuntu. By the way i need to get single input character from user's keyboard (like when a program ask you for y/n ?) so as key pressed and without pressing enter i need to read the entered character. I googled it a lot but all…
Roozbeh Sharafi
  • 347
  • 1
  • 6
  • 21
7
votes
1 answer

Fool python's os.isatty from a bash script

I am writing a bash script that will be called from cron. The bash script runs a python command that is sensing when it's in a terminal by using pythons os.isatty function and outputs different things depending on if it's run manually or via a…
Dogsbody
  • 293
  • 1
  • 11
7
votes
2 answers

Unable to provide long (1024+ character) inputs to the OCaml toplevel and coqtop (and Proof General)

Edit 4: It turns out that this is actually just a limitation of TTY input in general; there's nothing specific about OCaml, Coq, or Emacs which is causing the problem. I'm working on a Coq program using Proof General in Emacs, and I've found a bug…
Antal Spector-Zabusky
  • 36,191
  • 7
  • 77
  • 140
6
votes
1 answer

How to connect to nethack from Node.js?

I'm just starting an AI bot for the game nethack, and I can't bypass the 'human-check' that's in source. The section of code I'm talking about is nethack/sys/unix/unixunix.c: #ifdef TTY_GRAPHICS /* idea from rpick%ucqais@uccba.uc.edu *…
chrisdotcode
  • 1,569
  • 2
  • 17
  • 22
6
votes
1 answer

Set stty parameters

Im trying to use bash to read from ttyS0 and need to set the following but im struggling to figure it out databits = 7 stopbits = 2 parity = 0 flow control = 0 heres my code: #!/bin/bash # Port setting stty -F /dev/ttyS0 raw speed 1200 #…
afro360
  • 620
  • 3
  • 9
  • 22
6
votes
1 answer

Is it possible to accept user input as part of a remote git post-receive hook?

I've got a post-receive hook that deploys our master branch whenever we push master. I'd like to make the deployment optional; the hook asks for simple Y/N response to achieve this; bash pseudo code below: echo "Should I deploy this code now? Enter…
jaygooby
  • 2,436
  • 24
  • 42
6
votes
5 answers

Cross-platform method to detect whether /dev/tty is available & functional

I have a bash script from which I want to access /dev/tty, but only when it's available. When it's not available (in my case: when running my script in GitHub Actions) then when I try to access it I get /dev/tty: No such device or address, and I'm…
Tim Perry
  • 11,766
  • 1
  • 57
  • 85
6
votes
0 answers

python3 inside venv gives termios.error: (25, 'Inappropriate ioctl for device')

I've been running a python script inside a virtual environment that I create with pipenv shell, it worked well. I've always run the process from a bash script that changes directory to the folder containing the python script, activates the…
msoutopico
  • 357
  • 3
  • 15
6
votes
1 answer

How does `SIGWINCH` pass through Bash?

If I run a program in Bash that listens for SIGWINCH, and I resize the terminal that Bash is running in, then the program will receive SIGWINCH. I would like to know how this signal gets relayed to the program running under Bash. Here is my…
Sean Kelleher
  • 1,952
  • 1
  • 23
  • 34
6
votes
3 answers

clear scrollback buffer of Linux Virtual Console Terminals

I'd like to clear the scrollback buffer on Linux console VTs programmatically. i.e. not just clear the current visible screen, but the entire scrollback buffer, too. I.e. everything that after a clear screen would still be visible with Alt-PgUp…
user175104
  • 3,598
  • 2
  • 23
  • 20
6
votes
1 answer

Strange behaviour with tiny tty linux device driver

I'm having troubles with the tiny tty driver found in the book Linux Device Drivers. I had to adopt the code slightly to fit my requirements, so kicked out any code that was not relevant (see code below). I use a kernel thread that writes "hello…
Mr. T
  • 81
  • 4
6
votes
2 answers

In Rust, how can I capture process output with colors?

I would like to capture output from another process (for example git status), process it, and print with all styles (bold, italics, underscore) and colors. It's very important for me to further process that String, I don't want only to print it. In…
Wojciech Polak
  • 101
  • 2
  • 7