Command in Unix/Linux systems that allows you to set and print options for your terminal.
Questions tagged [stty]
103 questions
2
votes
1 answer
Determining Terminal lines/cols via PHP CLI
I know that it is quite easy to figure out a terminal's size parameters via the stty -a command. When using local CLI PHP scripts, there is no problem at all on grabbing that output via system() or so.
But I am trying the same thing via a php…

eFrane
- 89
- 1
- 6
1
vote
1 answer
Executing expect script from php. Can't get the stty settings right
I've got a php script that executes an expect script. Expect scipt connects remotely over telnet to another device, executes a couple of commands there and returns results. Php script is just a way to output the results returned by the remote device…

facha
- 11,862
- 14
- 59
- 82
1
vote
0 answers
How to read /dev/ttyS1 (when only write works)
After a kernel/busybox update my half-duplex /dev/ttyS1 port has become write only.
What works: echo "Hello ttyS1" > /dev/ttyS1
What doesn't work: cat /dev/ttyS1
Same pattern when I try writing c++ read/write interfaces: write works, read times…

Mr Blue
- 131
- 5
1
vote
1 answer
How to get stty echo mode from xterm.js?
I'd like to be able to tell when echo mode is turned off in xterm.js (for example, when entering a password). stty can report and change that information, but (obviously) can't be executed while waiting for a user to enter a password. What is the…

Mike Stay
- 1,071
- 8
- 17
1
vote
1 answer
Bash/Zsh issues with stty raw -echo
This issue has ariseb because I use reverse shells quite a lot and often need to upgrade the shell to enable tab autocomplete or cursor use. The issue is not just on reverse shells though, even if I use the following input in my own terminal I get…

omininja
- 31
- 3
1
vote
1 answer
Why is there a trailing "D" of my println!() output?
I am following this reference to implement a simple program which calculates the minimum number of inputs:
use std::io::prelude::*;
use std::io;
fn read_vec() -> Vec {
let mut vec: Vec = Vec::::new();
let stdin =…

Nan Xiao
- 16,671
- 18
- 103
- 164
1
vote
1 answer
trap "stty echo" INT has no effect when used with read -s
Given this bash script:
stty -echo
echo $(stty)
reset() {
stty echo
echo $(stty)
exit
}
trap reset int
read -s
sleep 10
I expected the echo option to be enabled, but after pressing ctrlc it is still disabled, even though I…

Szymon Marczak
- 1,055
- 1
- 16
- 31
1
vote
1 answer
stty serial port settings for parity not persistent
I have a netcore app that opens the serial port, and writes "parity error" on the console once a parity error gets detected. It works fine in Windows 10 but can't get it to work under Linux.
My assumption is that the OS is not passing the parity…

Luis Alvarado Day
- 217
- 1
- 3
- 14
1
vote
0 answers
Calling "stty size" in testing produces "Inappropriate ioctl for device" error, how to fix it?
I needed to get the dimensions of my terminal window and I found this question which provided a working solution for me. However, now I am writing a test for it, and both two of the top offered solutions (with cmd.Stdin = os.Stdin and Syscall) are…

Backflash
- 11
- 2
1
vote
2 answers
SSH while-loop in bash. Pseudo-terminal will not be allocated because stdin is not a terminal
I am trying to loop a file to ssh to a list of servers, and perform a find command on those servers for certain logfiles. I know that ssh will swallow the input file as a whole. So i am using the -n parameter to ssh. This works fine but oncertain…

Kevin
- 143
- 1
- 8
1
vote
1 answer
Stop echo and consume all user input in Bash
TARGET
Until some sub-task in script completes its job:
stop echo;
disable cursor;
consume all user input;
do not block interrupts (Ctrl+C, etc.).
WHAT HAVE DONE
For now, using this answer, I create few functions for that, here they are:
function…

urusai_na
- 393
- 4
- 11
1
vote
1 answer
Error with stty and STM32F4-DISCO (fourQ-package)
I recently downloaded the v3 of the FourQlib [1], build the FourQlib and wanted to test if everything went well.
First of all, my system:
Windows 10 (host) with MinGW, ARM Toolchain, MSYS, ...
Ubuntu 16.04 LTS (Guest) (gcc, arm toolchain,…

Shalec
- 172
- 9
1
vote
1 answer
Reset after using system call (stty raw)
I am using the following code to read and output each keystroke without having to press enter each time.
system("\bin\stty raw");
Right after I finish reading, the program does another system call to reset the terminal behaviour.…

CXB
- 241
- 5
- 14
1
vote
3 answers
How to delegate key press handling to rlwrap in raw mode terminal with tcl
I use stty raw -echo in my tcl terminal program.
What I want is to do some actions for only a few key press events such as Tab. For the rest of the key press events I want to delegate to rlwrap or other default handling program, such as ← to move…

Herbert
- 538
- 1
- 4
- 15
1
vote
0 answers
How can i send a binary file via serial in linux?
I want to control a hdmi matrix switch via serial connection.
In Windows i already tried it successful by the following steps:
Decode the necessary HEX from a simple textfile to a binary:
certutil -decodehex on.txt on.bin
Then configure the mode…

Borbosch
- 11
- 2
- 3