996 questions
Advice
1
vote
1
replies
52
views
How does getty work with systemd-logind on a linux system? What are their architectures?
I need clarification, since I fail to find a proper explanation on the internet and I don't trust ChatGPT.
What's the difference between linux getty program and systemd-logind? I understand that both ...
3
votes
2
answers
116
views
Write passphrase to a waiting/sleeping cryptsetup process
In an busybox based initramfs (archlinux mkinitcpio), I have cryptsetup waiting for a password to be provided by the console
ps | grep cryptsetup
200 root 11752 S cryptsetup open --type luks /...
3
votes
4
answers
158
views
Is it the tty, the shell, or both that is responsible for echo-ing user input?
I seem to be observing conflicting evidence regarding how the tty and the shell share responsibility for displaying user input.
In the following interactive session, user input is no longer echoed to ...
0
votes
0
answers
36
views
Is it possible for expect to log the `tty` responses to ANSI escape sequences?
Consider the following expect program, designed to log a full terminal interaction:
if { [info exists ::env(RAW_LOG_FILE) ] } {
log_file $::env(RAW_LOG_FILE)
}
eval spawn $argv
interact
When I run ...
0
votes
0
answers
154
views
Python SSH automation. Child process communication issues with /dev/tty
I am trying to automate SSH authentication on a jump server (bastion host) that requires both password and OTP. The script needs to:
Connect to SSH with authentication
Hand over control to the user ...
2
votes
1
answer
170
views
How to have a parent terminal view and pilot a child pseudo-terminal
Goal: In Python have a parent terminal start a program in a child pseudo-terminal (PTY), see its outputs and provide its inputs. At any given time, the parent terminal should be able to query what's ...
1
vote
1
answer
126
views
Bash logging out on login in tty
I wrote simple pam module to ran my own program, when session was created. When I login in GUI (by SDDM), everything works. Problem occurs, when login on tty (CTRL+ALT+Fn). In this case, bash wrote ...
0
votes
0
answers
19
views
Processing order in canonical mode
I am trying to figure out what exactly the POSIX specification stipulates for how characters are being processed in canonical mode. See https://pubs.opengroup.org/onlinepubs/9799919799/ chapter 11 &...
0
votes
0
answers
73
views
git pager over ssh terminal connection
I have problem with getting git pager working when I have ssh connection. I am using latest windows terminal and the remote is a ubuntu 24.
This config does not use less when I am running ie. git log ...
0
votes
0
answers
78
views
TMUX - bind issues
I am trying to get to use tmux on a daily basis.
It's all going quite well, and I'm enjoying it so far.
For more infos about what I'm using, I got ghostty as a terminal emulator and zsh (with ohmyzsh) ...
2
votes
2
answers
101
views
Is it possible to force a spawned process's controlling tty into the same state as it would be under interact?
Consider the following expect script, which attempts to automate an approval flow that is managed by a program X that we lack the source code for:
eval spawn $argv
set timeout -1
expect -ex {Approve ...
1
vote
1
answer
340
views
How do I make a blinking cursor in Python?
I'm developing a game for terminal, it takes inputs, so for taking input, it uses a get_key() which waits until user presses a key and then it returns the key pressed, it works similar to python's ...
1
vote
1
answer
157
views
TTY mode is not supported on Laravel using windows
While trying to use the command "php artisan db" to run sql commands on the VScode terminal, I got this message saying that TTY mode is not supported on Windows platform.
I read similar ...
1
vote
2
answers
183
views
Why does my terminal not perform carriage returns while docker is running?
I have a shell script starting a docker container. Before starting the container, it starts a background loop printing some lines to the terminal. I noticed that these printed lines do not return the ...
13
votes
4
answers
1k
views
Difference between fgetc() and read() function in C
While researching on file I/O in C, I came across two functions: fgetc() and read().
//code1.c
#include <stdio.h>
int main(void)
{
char ch;
ch = fgetc(stdin);
return 0;
}
//code2.c
#...