Questions tagged [stty]

Command in Unix/Linux systems that allows you to set and print options for your terminal.

103 questions
1
vote
1 answer

Should a host echo control characters? Which ones?

I'm building an embedded system that talks RS-232 to a serial terminal, "full-duplex" style, so the host echos what the terminal sends. I know printables (at least ASCII 0x20 to 0x7E) are normally echoed, but which control characters (if any) are…
nerdfever.com
  • 1,652
  • 1
  • 20
  • 41
1
vote
0 answers

USB devices affect stty (uart)

I'm writing program that communicates with MCUs via UART (stty) The platform I use is Acmesystems Acqua A5 (SAMA5D31) with Debian. The protocol between MCU and PC is following: MCU address, data, CRC. If all is ok, MCU generates a coresponding…
Maksim M
  • 11
  • 1
1
vote
1 answer

Reading ESC on Linux during unbuffered input in C

I wrote a getch function for program. I couldn't use curses as it breaks the terminal for iostream I already use. The code: inline std::string getch() { char inp[4]; system("stty raw"); inp[0] = std::cin.get(); if(inp[0] == 27 &&…
pkubik
  • 780
  • 6
  • 19
1
vote
1 answer

How to reset stdin after an EAGAIN error?

This is an error that I encountered in a large ruby script. I've managed to boil it down to what seems like the essence of the problem. In discussing this problem, the script was run by someone on OS/X without encountering the same problem, so…
1
vote
0 answers

Ruby: read_nonblock(???) breaks "system" command

I have two versions of a method, I encounter the same problem with both. version 1 def read_char $stdin.raw! input = $stdin.getc.chr if input == "\e" then input << $stdin.read_nonblock(3) rescue nil input << $stdin.read_nonblock(2)…
1
vote
1 answer

Arduino returning more responses than queries have been sent

I have a problem when using Arduino to post data to Pachube. The Arduino is configured to return JSON data for the temperature when you send a 't' and return JSON data for the light level when you send an 'l'. This works perfectly through the…
mikey
  • 161
  • 9
0
votes
3 answers

How to modify input stream of netcat?

I'm creating a TCP/IP interface to a serial device on a redhat linux machine. netcat in a bash script was used to accomplish this with out to much trouble. nc -l $PORT < $TTYDEVICE > $TTYDEVICE The problem is that the serial device uses carriage…
richmb
  • 1,495
  • 2
  • 15
  • 20
0
votes
2 answers

stty and sending carriage return

I have a serial device with which I am trying to communicate. This device knows when a complete command has been sent when the command string is terminated with a "\r". Thus, a typical command string might be something like "COMMAND \r". I'm having…
dataman
  • 303
  • 1
  • 3
  • 11
0
votes
0 answers

Drawing to screen and keeping image intact while using dialog

I am running on Raspbian (Debian 11) lite, with CLI only. I use a bash script with dialog to navigate a menu and perform bash actions. I would like to "mimic" the Raspbian start screen, when an image is shown above (or below) the lines of code…
Kevitto
  • 3
  • 4
0
votes
0 answers

Why settings for termios doesn't reset each time I run my program?

I'm trying to make a program which will listen to a serial port (gps antena) for logs sent by it every second. The program works as expected, but when I start listening with pygpsclient the termios settings are modified so I set them in my…
MBI
  • 15
  • 4
0
votes
0 answers

how to detect arrow keys using stty in c

I know how there are different ways of getting keyboard input such as conio.h, but I want to learn how to use this method. the getkey function uses stty for gathering keyboard input. char getkey() { char c; system("/bin/stty raw"); …
0
votes
0 answers

Failed to connect to the host via ssh: stty: standard input: Inappropriate ioctl for device

When I am trying to run an ansible playbook on the target CUCM, I see below error. [root@localhost ansibleuser]# ansible-playbook change_cucm_IP.yml -u admin --ask-pass -vvv [WARNING]: You are running the development version of Ansible. You should…
Harsha
  • 1
  • 2
0
votes
1 answer

Setting buad rate gives "unable to perform all requested operations"

I am on Ubuntu Mate and I am trying to set the baud rate for tty7. stty gives "unable to perform all requested operations". Any help?
Richard
  • 3
  • 4
0
votes
1 answer

Unable to revive interactive reverse shell using Python

I've been working on the Scriptkiddie box on Hack the Box and have got to the point of upgrading a dumb to interactive shell step using python. The suggested way to do this is the same as the final example here:…
laurie
  • 965
  • 1
  • 11
  • 21
0
votes
1 answer

Why does ‘stty -echo’ not turn off the echo bit on macOS

I am reading Understanding Unix/Linux Programming by Bruce Molay. In Chapter 5, the book introduces a new command stty which can help you configure your terminal setting. One example mentioned in the book is to use stty -echo to turn off the echo,…
Steve Lau
  • 658
  • 7
  • 13