Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
2
votes
1
answers
38
views
socat filter and replace character for modbus ascii
The goal is to get modbus ascii working with a Wallbox from ABL. So I placed a RS485 to TCP converter in the box, created a pseudo tty for my application and got the wrong frame. The answer starts with `>` and should start with `:`. So my approach is the following: ``` Terminal1: sudo socat -d -d -d...
The goal is to get modbus ascii working with a Wallbox from ABL.
So I placed a RS485 to TCP converter in the box, created a pseudo tty for my application and got the wrong frame.
The answer starts with
>
and should start with :
.
So my approach is the following:
Terminal1: sudo socat -d -d -d pty,link=/dev/ttyVA00,echo=0,perm=0777 pty,link=/dev/ttyVB00,echo=0,perm=0777
Terminal2: sudo socat -d -d -d pty,link=/dev/ttyV0,perm=0777 tcp:10.10.49.249:502
Terminal3: cat /dev/ttyVB00 > /dev/ttyV0
Terminal4: cat /:/g' > /dev/ttyVB00
Terminal5: ./modpoll -m ascii /dev/ttyVA00 -b 38400 -d 8 -p even -t4 -c 2 -0
And this works!
Could you give advice on how to simplify the socat solution and how to get it to autostart?
martin
(21 rep)
Jul 31, 2025, 10:49 AM
• Last activity: Aug 1, 2025, 08:57 AM
0
votes
0
answers
47
views
How does `/dev/tty` work as a "synonym"?
### Context To restore the standard input, standard output and/or standard error (file descriptors 0, 1 and/or 2 respectively) of a process to the keyboard and/or display of an interactive shell (bash) session, I have seen [here][1] that one can execute either of the following: $ exec &>/dev/tty or...
### Context
To restore the standard input, standard output and/or standard error (file descriptors 0, 1 and/or 2 respectively) of a process to the keyboard and/or display of an interactive shell (bash) session, I have seen here that one can execute either of the following:
$ exec &>/dev/tty
or
$ exec &>$(tty)
Whereas
$(tty)
(a command substitution) returns /dev/pts/X
where X
is the number associated to the currently active terminal window (pseudo-tty), thereby explicitly pointing the redirection to the "real" filename associated with the terminal in which the command is entered, in contrast /dev/tty
is a character file which *seems* to appear identical to different processes (i.e. to different concurrent terminal windows).
In man 4 tty
it says:
> The file /dev/tty [...] is a synonym for the controlling terminal of a process...
In The Open Group Base Specifications Issue 8, Chapter 10 it says:
> **/dev/tty**
>
> In each process, a synonym for the controlling terminal associated with the process group of that process, if any. It is useful for programs or shell procedures that wish to be sure of writing messages to or reading data from the terminal no matter how output has been redirected. It can also be used for applications that demand the name of a file for output, when typed output is desired and it is tiresome to find out what terminal is currently in use.
### Question
Since /dev/tty
is a file and not a symbolic link like /dev/fd
or /proc/self
, how can it "point" to different terminal processes when interpreted in different terminal windows? What does it mean in Unix/Linux parlance to be "a synonym" when not a symbolic link or a hard link — I mean: what is interpreting such a "synonym" when invoked on a command line and how?
The Quark
(402 rep)
Jul 24, 2025, 01:16 PM
• Last activity: Jul 25, 2025, 05:58 AM
2
votes
3
answers
4486
views
Arduino: avrdude: ser_open(): can't open device "/dev/ttyACM1": Input/output error
I use arduino ide on arch linux with arduino uno connected via USB. I am sure that I choosed right port and board in ide menu. when I run `ls -l /dev/ttyACM*` I get: ``` crw-rw---- 1 root uucp 166, 0 14. dub 12.44 /dev/ttyACM0 crw-rw-rw- 1 root uucp 166, 1 14. dub 12.54 /dev/ttyACM1 ``` bu...
I use arduino ide on arch linux with arduino uno connected via USB.
I am sure that I choosed right port and board in ide menu.
when I run
ls -l /dev/ttyACM*
I get:
crw-rw---- 1 root uucp 166, 0 14. dub 12.44 /dev/ttyACM0
crw-rw-rw- 1 root uucp 166, 1 14. dub 12.54 /dev/ttyACM1
but when I click upload I get this error:
Sketch uses 440 bytes (1%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
avrdude: Version 6.3, compiled on Jul 7 2020 at 19:38:43
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "//etc/avrdude.conf"
User configuration file is "/home/john/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyACM1
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude: ser_open(): can't open device "/dev/ttyACM1": Input/output error
avrdude done. Thank you.
the selected serial port
does not exist or your board is not connected
Error remains on newest linux kernel and LTS.
---
My device is Lenovo thinkpad X390: Linux 5.11.14-arch1-1
---
When I plug arduino to usb and then run sudo dmesg
I get this messages:
[ 1605.378324] usb 1-4: new full-speed USB device number 14 using xhci_hcd
[ 1605.520509] usb 1-4: New USB device found, idVendor=2341, idProduct=0043, bcdDevice= 0.01
[ 1605.520517] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=220
[ 1605.520521] usb 1-4: Manufacturer: Arduino (www.arduino.cc)
[ 1605.520523] usb 1-4: SerialNumber: 7583434383935150E152
[ 1605.523881] cdc_acm 1-4:1.0: ttyACM1: USB ACM device
[ 1630.618749] usb 1-9: reset full-speed USB device number 10 using xhci_hcd
[ 1630.792727] audit: type=1130 audit(1618567069.016:82): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=fprintd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[ 1632.601215] audit: type=1100 audit(1618567070.822:83): pid=29714 uid=1000 auid=1000 ses=1 msg='op=PAM:authentication grantors=? acct="john" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/1 res=failed'
[ 1635.720577] audit: type=1100 audit(1618567073.942:84): pid=29714 uid=1000 auid=1000 ses=1 msg='op=PAM:authentication grantors=pam_faillock,pam_permit,pam_faillock acct="john" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/1 res=success'
[ 1635.721507] audit: type=1101 audit(1618567073.942:85): pid=29714 uid=1000 auid=1000 ses=1 msg='op=PAM:accounting grantors=pam_unix,pam_permit,pam_time acct="john" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/1 res=success'
[ 1635.722751] audit: type=1110 audit(1618567073.946:86): pid=29714 uid=1000 auid=1000 ses=1 msg='op=PAM:setcred grantors=pam_faillock,pam_permit,pam_faillock acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/1 res=success'
[ 1635.727018] audit: type=1105 audit(1618567073.949:87): pid=29714 uid=1000 auid=1000 ses=1 msg='op=PAM:session_open grantors=pam_limits,pam_unix,pam_permit acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/1 res=success'
---
How can I fix this ?
Thank you for help
**PS:** If you need any more information, comment below and I will add it soon as possible.
Jan Černý
(1723 rep)
Apr 14, 2021, 11:16 AM
• Last activity: Jul 24, 2025, 06:28 PM
18
votes
2
answers
3502
views
zsh can't input to terminal when piping stdin and stdout with variable command that has tty output
System info: macOS Sierra 10.12.6 zsh 5.4.2 (x86_64-apple-darwin16.7.0) GNU bash, version 4.4.12(1)-release (x86_64-apple-darwin16.3.0) Scroll to the **EXAMPLES** at the bottom if you just want to dig in to the simplified examples that I made. NOTE: I am not a big `zsh` user. --- I was looking at th...
System info:
macOS Sierra 10.12.6
zsh 5.4.2 (x86_64-apple-darwin16.7.0)
GNU bash, version 4.4.12(1)-release (x86_64-apple-darwin16.3.0)
Scroll to the **EXAMPLES** at the bottom if you just want to dig in to the simplified examples that I made.
NOTE: I am not a big
zsh
user.
---
I was looking at the [fzf
](https://github.com/junegunn/fzf) keybindings for [bash
](https://github.com/junegunn/fzf/blob/master/shell/key-bindings.bash#L59) and [zsh
](https://github.com/junegunn/fzf/blob/master/shell/key-bindings.zsh#L73) .
Notice how they both run a variable command $(__fzfcmd)
. __fzfcmd
by default outputs fzf
to stdout and the parameter substitution just runs command (fzf
) resulting from the output.
One difference between the bash
and zsh
script is that the bash
one further pipes the output of $(__fzfcmd)
but zsh
just captures it inside an array. My guess is because of a problem in zsh
when you further pipe the output of fzf
where you can't input to fzf
and the process piped to by fzf
doesn't get any stdin. Your only choice is to ^Z
or ^C
. ^C
seems to background the process for some reason. Or maybe they just wanted it in an array so they could could [run zle vi-fetch-history
on it](https://github.com/junegunn/fzf/blob/master/shell/key-bindings.zsh#L78) . The bash
version does some magic in the key binding with ["\e^": history-expand-line
](https://github.com/junegunn/fzf/blob/master/shell/key-bindings.bash#L83)
Now fzf
isn't important. It seems like you just need a program that outputs to the tty
to be called by parameter substitution to cause this problem. So I will show some simpler examples.
Here are some other commands that output to the tty
that can cause this problem in zsh
:
- [vipe](https://linux.die.net/man/1/vipe) (run editor in middle of a pipe)
- 'vim -'
(make vim read from stdin. similar to vipe but won't output to stdout)
---
In the examples below, replace every occurrence of vipe
with vim -
if you don't want to do a separate install. Just remember that vim -
won't output the editor contents to stdout like vipe
does.
**EXAMPLES:**
1) echo 1 | vipe | cat # works in both bash and zsh
2) echo 1 | $(echo vipe) | cat # works in bash only. zsh problem with no output until I hit ^C
:
^C
zsh: done echo 1 |
zsh: suspended (tty output) $(echo vipe) |
zsh: interrupt cat
# seems like the process is backgrounded. I can still see it in jobs command
3) cat >(cat) # works in both bash and zsh
# The following don't have and input pipe to vipe.
# Type something then send EOF with ^D
6) vipe | cat # works for both
7) $(echo vipe) | cat # works for both
Now, I'm mostly wondering why 2)
has a problem for zsh
but not for bash
and why 4)
and 5)
fixes the problem for zsh
.
The requirements for zsh
to have this problem to seem to be exactly what I put in the title:
- input pipe
- command run by variable/parameter substitution that has tty
output
- output pipe
**UPDATE**
I added another workaround that doesn't cause zsh
to have this problem, 5)
. It's similar to 4)
but instead of redirecting stdout
directly into stin
, I redirect it into a file that redirects into stdin
using process substitution.
dosentmatter
(536 rep)
Dec 18, 2017, 10:44 PM
• Last activity: Jul 24, 2025, 04:48 AM
0
votes
0
answers
46
views
terminal after ssh only return 4 line stdout
So, I did a certification lab lately and after I logged in my ssh, I cannot use a command longer than X line (4 in F server lab and 29 in C server lab. My host kali machine is working and I've tried several thing including: - 'stty sane; bash' - '/bin/sh' - 'reset' - changing the terminal from qterm...
So, I did a certification lab lately and after I logged in my ssh, I cannot use a command longer than X line (4 in F server lab and 29 in C server lab. My host kali machine is working and I've tried several thing including:
- 'stty sane; bash'
- '/bin/sh'
- 'reset'
- changing the terminal from qterminal to gnome-terminal
- use tmux
- restarting / rebooting the lab and my host
- I've tried seq 1 100 output in ssh and exit (worked) but I cannot do it if I have interactive session in the ssh
- of course I can use seq 1 100 in my host machine
That's all that I've tried, are there any other data that I should provide in my host machine? I cannot provide .profile and .bashrc of the server machine because I cannot do stdout that much of line and I also cannot transfer it (I really don't understand why).
In the same time, I've asked the support lab team, hoping that they answer me in no time.
Any Idea or approach that I should try on?


hanysfa
(103 rep)
Jul 6, 2025, 11:00 AM
• Last activity: Jul 6, 2025, 11:02 AM
5
votes
1
answers
2451
views
Virtualize in multiple TTY (VT*)
I want to get virtual machine in a TTY (VT*) in fullscreen like GDM3 can take a TTY (VT*) for the graphic part of linux I want DISPLAY (heard as the output of a graphic server, here the VMs) to be redirected in a TTY (VT*), and not in a window like usually It will make like the computer run multiple...
I want to get virtual machine in a TTY (VT*) in fullscreen like GDM3 can take a TTY (VT*) for the graphic part of linux
I want DISPLAY (heard as the output of a graphic server, here the VMs) to be redirected in a TTY (VT*), and not in a window like usually
It will make like the computer run multiple OS at the same time but in fact it's a Linux Kernel who virtualize the differents OS that we can see on the different TTY (VT*)
You know, the TTY (VT*) in CTRL + ALT + Fi
----------
Okay
----------
Not okay


wxi
(189 rep)
Nov 7, 2019, 11:40 AM
• Last activity: Jul 4, 2025, 11:04 PM
1
votes
0
answers
31
views
How to set which tty to run GUI in?
I have set up a runit service to autologin in `/dev/tty16` and the shell profile executes `dbus-run-session Hyprland`, however, I noticed that Hyprland, or GUIs start on the 'active' or the currently shown tty. How can I specify what tty to use a GUI application in?
I have set up a runit service to autologin in
/dev/tty16
and the shell profile executes dbus-run-session Hyprland
, however, I noticed that Hyprland, or GUIs start on the 'active' or the currently shown tty. How can I specify what tty to use a GUI application in?
Caesar
(25 rep)
Jun 29, 2025, 08:10 PM
2
votes
1
answers
201
views
TTY line discipline echoing feature
I'm confused from the actual meaning of the echoing feature implemented in Linux `TTY` driver. As far as I know, a pseudo-terminal pair (`PTY` pair) consists of a `PTY` master, a `PTY` slave and a line discipline all implemented in kernel code (i.e. kernel code running in kernel space). From my unde...
I'm confused from the actual meaning of the echoing feature implemented in Linux
TTY
driver.
As far as I know, a pseudo-terminal pair (PTY
pair) consists of a PTY
master, a PTY
slave and a line discipline all implemented in kernel code (i.e. kernel code running in kernel space).
From my understanding, echoing is the feature of sending back what is written on the master side ptm
so that the process opening such a fd
(by opening the PTY
multiplexer /dev/ptmx
device file) receives back what it has written to.
My questions:
- is this echo feature implemented within the line discipline kernel code ?
- does this echo feature apply only to the PTY
master side, i.e. it doesn't
send back what is written to the PTY
slave side /dev/pts/x
?
Thanks.
CarloC
(385 rep)
Jun 21, 2025, 09:36 AM
• Last activity: Jun 23, 2025, 10:54 AM
2
votes
2
answers
56
views
Unable to write to self in graphical terminal session?
Essentially, I noticed I am unable to write to my user who is using `gnome-terminal`. `tty` returns `/dev/pts/1`, but I am unable to write there as root. Instead, it returns as follows: ``` myuser@pegasus:/$ tty /dev/pts/1 root@pegasus:/# write myuser pts/1 write: myuser is not logged in on pts/1 ``...
Essentially, I noticed I am unable to write to my user who is using
gnome-terminal
.
tty
returns /dev/pts/1
, but I am unable to write there as root. Instead, it returns as follows:
myuser@pegasus:/$ tty
/dev/pts/1
root@pegasus:/# write myuser pts/1
write: myuser is not logged in on pts/1
I have also tried write myuser tty2
, and tried not specifying the terminal, but nothing happens. How can I write to my session?
The inverse works fine:
myuser@pegasus:/$ write root pts/0
hi!
please respond
root@pegasus:/#
Message from myuser@pegasus on pts/1 at 22:05 ...
hi!
please respond
EOF
Here is what the logins look like.
root@pegasus:/# who -aT
system boot 2025-06-19 21:34
run-level 5 2025-06-19 21:34
myuser ? seat0 2025-06-19 21:34 ? 2982 (login screen)
myuser + tty2 2025-06-19 21:34 00:37 2982 (tty2)
pts/1 2025-06-19 21:41 25698 id=ts/1 term=0 exit=0
myuser@pegasus:/$ loginctl
SESSION UID USER SEAT LEADER CLASS TTY IDLE SINCE
11 0 root - 79869 manager-early - no -
2 1000 myuser seat0 2891 user tty2 no -
3 1000 myuser - 2911 manager - no -
c11 0 root - 79732 user-early pts/0 no -
4 sessions listed.
Vesta Tian
(81 rep)
Jun 19, 2025, 02:10 PM
• Last activity: Jun 21, 2025, 01:20 PM
2
votes
2
answers
121
views
How can I get Linux console output on both iGPU (HDMI) and IPMI (AST) simultaneously?
I'm trying to get console output on **both the onboard iGPU (Intel i915, HDMI output)** and **the AST BMC (IPMI remote display)** on my headless server setup. #### Hardware and OS * **Motherboard**: ASUS Pro WS W680-ACE IPMI * **CPU**: Intel i9-14900 * **OS**: Ubuntu 24.04.2 LTS (Pro), kernel `6.8.0...
I'm trying to get console output on **both the onboard iGPU (Intel i915, HDMI output)** and **the AST BMC (IPMI remote display)** on my headless server setup.
#### Hardware and OS
* **Motherboard**: ASUS Pro WS W680-ACE IPMI
* **CPU**: Intel i9-14900
* **OS**: Ubuntu 24.04.2 LTS (Pro), kernel
6.8.0-60-generic
, UEFI boot
* systemd
is in use and default GRUB is installed
#### BIOS Settings
All relevant GPU-related options are enabled:
Primary Display [CPU Graphics]
iGPU Multi-Monitor [Enabled]
DVMT Pre-Allocated [64M]
RC6 (Render Standby) [Enabled]
When I boot into the BIOS firmware setup, **both HDMI and IPMI outputs mirror the BIOS screen correctly**, confirming that hardware-level multi-display support is working.
#### Framebuffer Devices
After booting Linux:
$ ls /dev/fb*
/dev/fb0 /dev/fb1
$ cat /sys/class/graphics/fb*/name
i915drmfb
astdrmfb
So:
* /dev/fb0
= Intel iGPU (HDMI)
* /dev/fb1
= AST BMC (IPMI)
#### What I’ve Tried
I’ve tried modifying /etc/default/grub
with various combinations of fbcon=map:
and console=ttyX
:
1. GRUB_CMDLINE_LINUX_DEFAULT="fbcon=map:1,0 console=tty1 console=tty2"
→ **Only IPMI (fb1) works**, HDMI stays black.
2. GRUB_CMDLINE_LINUX_DEFAULT="fbcon=map:0,1 console=tty1 console=tty2"
→ **Only HDMI (fb0) works**, IPMI stays black.
3. GRUB_CMDLINE_LINUX_DEFAULT="fbcon=map:both console=tty1 console=tty2"
→ **Nothing appears on either display**.
(Yes, I realize fbcon=map:1,0
maps tty1 to fb1 and tty2 to fb0 — that behavior is expected.)
I also enabled getty@tty2.service
and confirmed it’s running.
---
### What I Want
* Ideally: **Same console output mirrored** on both HDMI and IPMI
* Acceptable: **Separate virtual terminals** (e.g., tty1 on IPMI, tty2 on HDMI)
But so far I can only get one to work at a time, depending on how I order fbcon=map
.
Any suggestions? Is this a limitation in fbcon
, the kernel, or something I can work around with udev, early KMS, or a boot service?
Dennis Solomon
(51 rep)
Jun 19, 2025, 03:40 PM
• Last activity: Jun 20, 2025, 05:31 PM
10
votes
1
answers
4578
views
ssh with separate stdin, stdout, stderr AND tty
### Problem Consider a command like this: binary_output 2>error.log where `tool` is arbitrary and `ssh` is a wrapper or some `ssh-like-contraption` that allows the above to work. With regular `ssh` it doesn't work. I used `sudo` here but it's just an *example* of a command that requires tty. I'd lik...
### Problem
Consider a command like this:
binary_output 2>error.log
where
tool
is arbitrary and ssh
is a wrapper or some ssh-like-contraption
that allows the above to work. With regular ssh
it doesn't work.
I used sudo
here but it's just an *example* of a command that requires tty. I'd like a general solution, not specific to sudo
.
---
### Research: the cause
With regular ssh
it doesn't work because:
- sudo
needs tty to ask for password (or to work at all ), so I need ssh -t
; actually in this case I need ssh -tt
.
- On the other hand ssh -tt
will make sudo
read the password from binary_input
. I want to provide the password via my local tty. Even if sudo
is configured to work without password or if I inject the password to the binary_input
, ssh -tt
will make sudo
and tool
read from the remote tty and write output *and* errors and prompts to the remote tty. Not only I won't be able to tell the output and the errors/prompts apart locally. All the streams will be processed by the remote tty and this will mangle data (you can see this in some examples in this answer of mine , in the section entitled "Some practice").
---
### Research: comparison to commands that work
- This local command is the reference point. Let's assume it successfully processes some binary data:
binary_output
- If I need to run tool
on a server, I can do this. Even if ssh
asks for my password , this will work:
binary_output
In this case ssh
is transparent for binary data.
- Similarly local sudo
can be transparent. The following command won't mangle the data even if sudo
asks for my password:
binary_output
- But running tool
on the server with sudo
is troublesome:
binary_output
In this configuration ssh
and sudo
*together* cannot be transparent in general. Finding a way to make them transparent is the gist of this question.
---
### Research: similar questions
I have found few similar questions:
- Use sudo
with ssh
command and capturing stdout
This question cares about stdout only. The existing answer (from the author of the question) advises sudo -S
which consumes stdin. I don't really want to alter my binary_input
. And I would appreciate a solution not specific to sudo
.
- stderr over ssh -t
This concentrates on passing Ctrl+c and the background is GNU parallel
. A workaround that only makes Ctrl+c work without a remote tty is not enough for me.
- SSH: Provide additional “pipe” fds in addition to stdin, stdout, stderr
This is a good start (especially this answer , I think). However here I want to emphasize the need for tty. I want a solution that automates things and allows me to use remote sudo
(or whatever) as if it was local.
---
### My explicit question
In the following command:
binary_output 2>error.log
requires-tty
is a placeholder for code that requires a tty but processes binary data from its stdin to its stdout. It seems I need ssh -tt
, otherwise requires-tty
will not work; and at the same time I mustn't use ssh -tt
, otherwise the binary data will be mangled. How can I solve this problem in a convenient way?
requires-tty
can be sudo …
but I don't want a solution specific to sudo
.
I imagine the ideal(?) solution will be a script/tool that replaces ssh
in the above invocation and just works. It should(?) connect the remote stdin, stdout and stderr each to its local counterpart, *and* the remote tty to the local tty.
If it's possible, I prefer a client-side solution that does not require any server-side companion program.
Kamil Maciorowski
(24294 rep)
Jun 8, 2021, 05:42 PM
• Last activity: Jun 18, 2025, 07:35 AM
0
votes
4
answers
560
views
Running process in background ruins terminal
I have this `makefile`: ``` all: sudo watch "ls -l" > /dev/null & @echo line 1 @echo line 2 @echo line 3 @echo line 4 ``` Running `watch` (**or any other process that somehow changes the terminal**) ruins the terminal. This is the output. You can see these big spaces. Also, I can't see the character...
I have this
makefile
:
all:
sudo watch "ls -l" > /dev/null &
@echo line 1
@echo line 2
@echo line 3
@echo line 4
Running watch
(**or any other process that somehow changes the terminal**) ruins the terminal. This is the output. You can see these big spaces. Also, I can't see the characters afterwards, when I write:
me@me:/tmp$ make
watch "ls -l" > /dev/null &
line 1
line 2
line 3
line 4
me@me:/tmp$
Is there a way to prevent a process changing the terminal?
**A clarification**: watch
is just a **reproductible example**. I'm using another app that should run as daemon, but still ruins the terminal.
---
Edit: I start this app (on this example, the app is watch
) with sudo
**A workaround** is to start it without sudo
- then the terminal isn't ruined.
The disadvantage in that is, that I need to chown
this process to not be root:root
.
hudac
(791 rep)
Sep 11, 2022, 01:00 PM
• Last activity: Jun 16, 2025, 12:33 PM
1
votes
1
answers
4314
views
getty@tty1.service FAILED - Autologin only shows on TTY1 a flashing _
I'm working on a minecraft server with OS Ubuntu server 20.04 So far they haven't given me any problems (it's fantastic!), I know some things about linux (some don't exaggerate) Until something came to me. I'll be out of the house, but I'll have my laptop. The problem is the following, I want to pla...
I'm working on a minecraft server with OS Ubuntu server 20.04
So far they haven't given me any problems (it's fantastic!), I know some things about linux (some don't exaggerate)
Until something came to me. I'll be out of the house, but I'll have my laptop.
The problem is the following, I want to play minecraft with my friends but every time I start the computer it asks me to enter the password.
Things I'd like to do: Enable Auto-login
What I've already tried:
systemctl edit getty@tty1.service
[Service]
ExecStart=
ExecStart=-/usr/bin/agetty --autologin simao --noclear %I 38400 linux
I've also tried replacing the last line with ExecStart=-/usr/bin/agetty --autologin simao --noclear %I %TERM
What happens when turning off and on again: On tty1 appears the normal starting and then only a flashing _
When running the following command sudo systemctl --failed
Gives the following output
UNIT LOAD ACTIVE SUB DESCRIPTION
getty@tty1.service loaded failed failed Getty on tty1
Then I ran the following command sudo systemctl status getty@tty1.service
And gives the following output "
getty@tty1.service - Getty on tty1
Loaded: loaded (/lib/systemd/system/getty@.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/getty@tty1.service.d
└─override.conf
Active: failed (Result: start-limit-hit) since Mon 2022-07-25 12:39:35 UTC; 11min ago
Docs: man:agetty(8)
man:systemd-getty-generator(8)
http://0pointer.de/blog/projects/serial-console.html
Process: 1077 ExecStart=/usr/bin/agetty --autologin simao --noclear tty1 38400 linux (code=exited, status=0/SUCCESS)
Main PID: 1077 (code=exited, status=0/SUCCESS)
Jul 25 12:39:35 minecraft-server-simao-vilas systemd: getty@tty1.service: Succeeded.
Jul 25 12:39:35 minecraft-server-simao-vilas systemd: getty@tty1.service: Scheduled restart job, restart counter is at 5.
Jul 25 12:39:35 minecraft-server-simao-vilas systemd: Stopped Getty on tty1.
Jul 25 12:39:35 minecraft-server-simao-vilas systemd: getty@tty1.service: Start request repeated too quickly.
Jul 25 12:39:35 minecraft-server-simao-vilas systemd: getty@tty1.service: Failed with result 'start-limit-hit'.
Jul 25 12:39:35 minecraft-server-simao-vilas systemd: Failed to start Getty on tty1.
EDIT: If someone needs more info, only ask and i will edit the post with the info right away (not exactly but the fast i can)
Devilas
(87 rep)
Jul 25, 2022, 11:55 AM
• Last activity: Jun 9, 2025, 03:09 PM
7
votes
2
answers
11187
views
cat: /dev/ttyS0: Input/output error
I am unable to write to or read from `/dev/ttyS0` # cat /dev/ttyS0 cat: /dev/ttyS0: Input/output error the device exists, and root has permissions. # ls -lAhF /dev/ttyS0 crw------- 1 root root 4, 64 Nov 18 12:09 /dev/ttyS0 # setserial -g /dev/ttyS0 /dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4 # dm...
I am unable to write to or read from
/dev/ttyS0
# cat /dev/ttyS0
cat: /dev/ttyS0: Input/output error
the device exists, and root has permissions.
# ls -lAhF /dev/ttyS0
crw------- 1 root root 4, 64 Nov 18 12:09 /dev/ttyS0
# setserial -g /dev/ttyS0
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
# dmesg | egrep -i 'serial|ttys'
[ 1.243271] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[ 2703.151301] ttyS0: LSR safety check engaged!
# cat /proc/devices | grep tty
4 tty
4 ttyS
5 /dev/tty
I have serial enabled in my kernel:
# grep SERIAL config
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_NR_UARTS=1
CONFIG_SERIAL_8250_RUNTIME_UARTS=1
CONFIG_SERIAL_CORE=y
**What do I have to do to make serial work ?**
Martin Vegter
(586 rep)
Nov 18, 2017, 12:08 PM
• Last activity: Jun 4, 2025, 10:04 AM
0
votes
1
answers
95
views
Making the micro editor behave like a desktop terminal in a Linux TTY
Can I, through a trick or a module, make the Micro editor behave in a separate TTY as if I had started it directly from a console/terminal emulator in my desktop environment? - [micro | a modern and intuitive terminal-based text editor][1] **Setup**: Debian 12, Bash, KDE/Gnome ##### The core feature...
Can I, through a trick or a module, make the Micro editor behave in a separate TTY as if I had started it directly from a console/terminal emulator in my desktop environment?
- micro | a modern and intuitive terminal-based text editor
**Setup**: Debian 12, Bash, KDE/Gnome
##### The core feature I'm searching for:
I just want to mark text/ part of a text using the arrow keys + Shift.
Is this possible, or is it fundamentally impossible because the Linux kernel console (e.g., tty1) does not support this?
##### Results I discovered:
>The kernel console (TTY) does not support extended modifier sequences like Shift+arrow keys, which means it is not possible to select text using Shift+arrow keys in the Micro editor when running in the TTY.
>
>According to the official man page console_codes(4), the Linux console implements only a subset of the VT102 and ECMA-48/ISO 6429/ANSI X3.64 terminal controls.
>
>In particular, it lacks support for extended input sequences that are handled by modern terminal emulators like xterm.
This means the console does not send escape sequences for combined keys such as Shift+arrow keys.
- linux man page for console_codes
- console_codes - Linux console escape and control sequences
- bash: Shift+arrow keys make A,B,C,D
- console_codes(4) — Linux manual page
The loadkeys keymaps use tricks to assign different sequences to function keys (F1–F12) combined with modifiers like Alt or Ctrl.
But that probably works because the kernel has explicit support for it but it looks like not for Shift+Arrow.
- keymaps (5)
From @Gilles 'SO- stop being evil' answer:
- Detecting shift + keyup/down in the terminal
>Terminals don't send key up events. (Your use case doesn't require them, though, according to your description.)
>
>Unless you can afford to require a specific terminal emulator (e.g. recent-ish xterm), don't rely on the user being able to type Shift+Up. Support an alternate method, such as a “start multiple selection” key followed by plain Up/Down
ReflectYourCharacter
(8185 rep)
May 30, 2025, 05:00 PM
• Last activity: May 31, 2025, 09:08 AM
6
votes
1
answers
2907
views
Mocking a pseudo tty (pts)
We would like to run some `curses` based apps in background. These apps use `curses` and get the current `tty` port name to be used internally to map log files and others context-terminal associations. In some tests just redirecting the input from `curses` apps that don't read the keyboard to a know...
We would like to run some
curses
based apps in background.
These apps use curses
and get the current tty
port name to be used internally to map log files and others context-terminal associations.
In some tests just redirecting the input from curses
apps that don't read the keyboard to a known pts
, worked. And so they can be executed in background, since I reserve a tty (or pseudo tty) for that.
Is it possible to mock a tty, or has a reserved pts
to some automatic running purposes, like that? We plain to launch them through crontab
.
Luciano
(1189 rep)
Jul 8, 2015, 09:10 PM
• Last activity: May 27, 2025, 12:03 PM
0
votes
1
answers
3563
views
Send binary file to ttyUSB0 serially in linux
I have a binary file(obtained from assembly code). I need to transfer this file to an fpga serially via ttyUSB0. I read in some posts that using cat and echo data can be transferred to ttyS0. ``` echo -ne '\033[2J' > /dev/ttyS1 cat < /dev/ttyS1 ``` Does this apply for ttyUSB0 as well? If not, please...
I have a binary file(obtained from assembly code). I need to transfer this file to an fpga serially via ttyUSB0.
I read in some posts that using cat and echo data can be transferred to ttyS0.
echo -ne '\033[2J' > /dev/ttyS1
cat < /dev/ttyS1
Does this apply for ttyUSB0 as well? If not, please suggest me other ways to transfer binary file via ttyUSB0.
karthik
(1 rep)
Jan 9, 2020, 10:59 AM
• Last activity: May 27, 2025, 02:04 AM
1
votes
1
answers
72
views
How to get out of login loop?
I login from the tty. my .xinit file had the command `exec i3`I got tired of constantly retyping startx after login so i put `exec startx`at the end of my .bash_profile. now every time I type my login credentials it flashes a failed startx the reprompts me for the login credentials again. I can't lo...
I login from the tty. my .xinit file had the command
exec i3
I got tired of constantly retyping startx after login so i put exec startx
at the end of my .bash_profile. now every time I type my login credentials it flashes a failed startx the reprompts me for the login credentials again. I can't log into the computer anymore. I tried pressing ctrl-c which didn't do anything and I tried holding the power button which just turned off the laptop.
edit: I use the newest version of Linux mint cinnamon which comes with light DM display manager by default. I had only disabled it for a day which was when the issue happened
user25371139
(13 rep)
May 25, 2025, 05:56 PM
• Last activity: May 26, 2025, 02:15 AM
0
votes
0
answers
134
views
What's the point of removing KMS with nvidia drivers? It seems to only cause errors
> Remove `kms` from the `HOOKS` array in `/etc/mkinitcpio.conf` and [regenerate the initramfs](https://wiki.archlinux.org/title/Regenerate_the_initramfs). This will prevent the initramfs from containing the `nouveau` module making sure the kernel cannot load it during early boot. The [nvidia-utils](...
> Remove
kms
from the HOOKS
array in /etc/mkinitcpio.conf
and [regenerate the initramfs](https://wiki.archlinux.org/title/Regenerate_the_initramfs) . This will prevent the initramfs from containing the nouveau
module making sure the kernel cannot load it during early boot. The [nvidia-utils](https://archlinux.org/packages/?name=nvidia-utils) package contains a file which blacklists the nouveau
module once you reboot.
The above quote from the Arch Linux wiki page for [NVIDIA](https://wiki.archlinux.org/title/NVIDIA) says to remove the kms hook after installing nvidia drivers so that nouveau can't conflict with them (or at least I think that's what it means!).
However upon removing it, I experience problems with my vconsole tty on boot, including the font not being set correctly and the login prompt being (visually) corrupted by a kernel error msg:
[[bottom 20% of an ascii art defined in /etc/issue that had displayed fully when kms wasn't deleted]]
emmy login: [ 5.559980] i915 0000:00:02.0: [drm] *ERROR* Failed to probe lspcon
Then I saw that even with the kms hook added lsmod | grep nouveau
shows nouveau isn't loaded. So what's the point of removing the kms hook when it seems that all it does is cause errors from weird loading orders of modules? And what does the hook actually do?
Here is my journalctl for both cases (I am using a intel i915 integrated graphics card + an nvidia GTX 1650 card):
KMS removed: journalctl -b | grep -E "nvidia|drm|fbcon|i915"
May 04 23:39:11 emmy kernel: Command line: initrd=\intel-ucode.img initrd=\initramfs-linux.img root=UUID=c0f85f88-6e8a-4002-8367-52c4141be5c6 rw nvidia_drm.modeset=1
May 04 23:39:11 emmy kernel: The simpledrm driver will not be probed
May 04 23:39:11 emmy kernel: Kernel command line: initrd=\intel-ucode.img initrd=\initramfs-linux.img root=UUID=c0f85f88-6e8a-4002-8367-52c4141be5c6 rw nvidia_drm.modeset=1
May 04 23:39:11 emmy kernel: ACPI: bus type drm_connector registered
May 04 23:39:11 emmy kernel: fbcon: Deferring console take-over
May 04 23:39:11 emmy kernel: fbcon: Taking over console
May 04 23:39:11 emmy systemd: Starting Load Kernel Module drm...
May 04 23:39:11 emmy systemd: modprobe@drm.service: Deactivated successfully.
May 04 23:39:11 emmy systemd: Finished Load Kernel Module drm.
May 04 23:39:11 emmy kernel: nvidia: loading out-of-tree module taints kernel.
May 04 23:39:11 emmy kernel: nvidia: module verification failed: signature and/or required key missing - tainting kernel
May 04 23:39:11 emmy kernel: nvidia-nvlink: Nvlink Core is being initialized, major device number 238
May 04 23:39:11 emmy kernel: nvidia 0000:01:00.0: enabling device (0000 -> 0003)
May 04 23:39:11 emmy systemd-modules-load: Inserted module 'nvidia_uvm'
May 04 23:39:12 emmy kernel: nvidia-modeset: Loading NVIDIA UNIX Open Kernel Mode Setting Driver for x86_64 570.144 Release Build (archlinux-builder@echo archlinux)
May 04 23:39:12 emmy kernel: [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver
May 04 23:39:13 emmy kernel: i915 0000:00:02.0: [drm] Found coffeelake (device ID 3e9b) integrated display version 9.00 stepping N/A
May 04 23:39:15 emmy kernel: i915 0000:00:02.0: vgaarb: deactivate vga console
May 04 23:39:15 emmy kernel: i915 0000:00:02.0: vgaarb: VGA decodes changed: olddecodes=io+mem,decodes=io+mem:owns=io+mem
May 04 23:39:15 emmy kernel: i915 0000:00:02.0: [drm] Finished loading DMC firmware i915/kbl_dmc_ver1_04.bin (v1.4)
May 04 23:39:15 emmy kernel: mei_hdcp 0000:00:16.0-b638ab7e-94e2-4ea2-a552-d1c54b627f04: bound 0000:00:02.0 (ops i915_hdcp_ops [i915])
May 04 23:39:15 emmy kernel: [drm] Initialized nvidia-drm 0.0.0 for 0000:01:00.0 on minor 0
May 04 23:39:15 emmy kernel: nvidia 0000:01:00.0: [drm] No compatible format found
May 04 23:39:15 emmy kernel: nvidia 0000:01:00.0: [drm] Cannot find any crtc or sizes
May 04 23:39:15 emmy kernel: i915 0000:00:02.0: [drm] *ERROR* Failed to probe lspcon
May 04 23:39:15 emmy kernel: [drm] Initialized i915 1.6.0 for 0000:00:02.0 on minor 1
May 04 23:39:15 emmy kernel: fbcon: i915drmfb (fb0) is primary device
May 04 23:39:15 emmy kernel: snd_hda_intel 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
May 04 23:39:15 emmy kernel: i915 0000:00:02.0: [drm] fb0: i915drmfb frame buffer device
KMS not removed (login screen and ascii art works fine):
May 04 23:47:03 emmy kernel: Command line: initrd=\intel-ucode.img initrd=\initramfs-linux.img root=UUID=c0f85f88-6e8a-4002-8367-52c4141be5c6 rw nvidia_drm.modeset=1
May 04 23:47:03 emmy kernel: The simpledrm driver will not be probed
May 04 23:47:03 emmy kernel: Kernel command line: initrd=\intel-ucode.img initrd=\initramfs-linux.img root=UUID=c0f85f88-6e8a-4002-8367-52c4141be5c6 rw nvidia_drm.modeset=1
May 04 23:47:04 emmy kernel: ACPI: bus type drm_connector registered
May 04 23:47:04 emmy kernel: fbcon: Deferring console take-over
May 04 23:47:04 emmy kernel: fbcon: Taking over console
May 04 23:47:04 emmy kernel: i915 0000:00:02.0: [drm] Found coffeelake (device ID 3e9b) integrated display version 9.00 stepping N/A
May 04 23:47:04 emmy kernel: i915 0000:00:02.0: vgaarb: deactivate vga console
May 04 23:47:04 emmy kernel: i915 0000:00:02.0: vgaarb: VGA decodes changed: olddecodes=io+mem,decodes=io+mem:owns=io+mem
May 04 23:47:04 emmy kernel: i915 0000:00:02.0: [drm] Finished loading DMC firmware i915/kbl_dmc_ver1_04.bin (v1.4)
May 04 23:47:04 emmy kernel: i915 0000:00:02.0: [drm] *ERROR* Failed to probe lspcon
May 04 23:47:04 emmy kernel: [drm] Initialized i915 1.6.0 for 0000:00:02.0 on minor 0
May 04 23:47:04 emmy kernel: fbcon: i915drmfb (fb0) is primary device
May 04 23:47:04 emmy kernel: i915 0000:00:02.0: [drm] fb0: i915drmfb frame buffer device
May 04 23:47:04 emmy systemd: Starting Load Kernel Module drm...
May 04 23:47:04 emmy systemd: modprobe@drm.service: Deactivated successfully.
May 04 23:47:04 emmy systemd: Finished Load Kernel Module drm.
May 04 23:47:04 emmy kernel: nvidia: loading out-of-tree module taints kernel.
May 04 23:47:04 emmy kernel: nvidia: module verification failed: signature and/or required key missing - tainting kernel
May 04 23:47:04 emmy kernel: nvidia-nvlink: Nvlink Core is being initialized, major device number 236
May 04 23:47:04 emmy kernel: nvidia 0000:01:00.0: enabling device (0000 -> 0003)
May 04 23:47:04 emmy systemd-modules-load: Inserted module 'nvidia_uvm'
May 04 23:47:04 emmy kernel: nvidia-modeset: Loading NVIDIA UNIX Open Kernel Mode Setting Driver for x86_64 570.144 Release Build (archlinux-builder@echo archlinux)
May 04 23:47:04 emmy kernel: mei_hdcp 0000:00:16.0-b638ab7e-94e2-4ea2-a552-d1c54b627f04: bound 0000:00:02.0 (ops i915_hdcp_ops [i915])
May 04 23:47:04 emmy kernel: [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver
May 04 23:47:05 emmy kernel: snd_hda_intel 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
May 04 23:47:06 emmy kernel: [drm] Initialized nvidia-drm 0.0.0 for 0000:01:00.0 on minor 1
May 04 23:47:06 emmy kernel: nvidia 0000:01:00.0: [drm] No compatible format found
May 04 23:47:06 emmy kernel: nvidia 0000:01:00.0: [drm] Cannot find any crtc or sizes
I don't see what the difference is because both end up with my i915 card using the framebuffer.
SmolScorbunny
(1 rep)
May 4, 2025, 11:08 PM
• Last activity: May 5, 2025, 08:24 AM
1
votes
0
answers
57
views
How to pretend to not run the command in a TTY
I have a command (`systemctl status`) that halts and waits for keystrokes if I run it in a terminal that is not tall enough. I'm not interested in this behavior and can't find an option to bypass it. If I make the output of the command not a tty, it doesn't stop. So what is the most efficient way to...
I have a command (
systemctl status
) that halts and waits for keystrokes if I run it in a terminal that is not tall enough. I'm not interested in this behavior and can't find an option to bypass it.
If I make the output of the command not a tty, it doesn't stop.
So what is the most efficient way to do so? So far I am using
systemctl status | tee /dev/null
but are there shorter or more efficient options?
Although I ask the question for systemctl
(that has a direct way to handle this), I'm curious to know the answer(s) for the more general case where a command has different tty and non-tty behaviors, and I want the non-tty behavior on a tty.
(Ubuntu 24.04 and bash 5.2.21)
xenoid
(9288 rep)
Apr 29, 2025, 10:27 AM
• Last activity: Apr 29, 2025, 12:30 PM
Showing page 1 of 20 total questions