Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terminal discards first keypress #3

Open
samuelkarp opened this issue Apr 16, 2021 · 5 comments
Open

terminal discards first keypress #3

samuelkarp opened this issue Apr 16, 2021 · 5 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@samuelkarp
Copy link
Owner

samuelkarp commented Apr 16, 2021

When running a container with a terminal (through ctr run --tty), the first keypress after the container starts running appears to be discarded.

@samuelkarp samuelkarp added bug Something isn't working help wanted Extra attention is needed labels Apr 16, 2021
@gizahNL
Copy link
Contributor

gizahNL commented May 7, 2021

It might not be related, but FreeBSD requires TIOCSCTTY to be called by the session group leader to set the controlling console, it doesn't set the tty automatically as controlling when opening the slave terminal. (see: https://www.freebsd.org/cgi/man.cgi?query=termios&apropos=0&sektion=4&manpath=FreeBSD+13.0-current&arch=default&format=html section "Controlling terminal")

/bin/csh is also complaining about lacking a proper terminal when ran via runj (but not when I jexec into the same jail by hand)

@gizahNL
Copy link
Contributor

gizahNL commented May 7, 2021

OK, tested it, doesn't fix the first keypress missing issue, does fix the

Warning: no access to tty (Bad file descriptor).
Thus no job control in this shell.

error spewed out by csh

@davidchisnall
Copy link

It doesn't look as if jexec does anything with the TTY, it just inherits whatever the caller had. It does take care to propagate the TERM environment variable, even if it's cleaning the environment. It is setting the user context, which may have some impact on the TTY that I don't understand (in particular, this will set the LANG, MM_CHARSET and TERM environment variables to the defaults for the login class, which may impact how csh interacts with the TTY). @gizahNL, do you see any interesting differences between the output of env when run from jexec vs runj?

@gizahNL
Copy link
Contributor

gizahNL commented Jun 11, 2021

@davidchisnall The controlling terminal issue I fixed via 9140284 unfortunately that was not the cause of the first keypress getting discarded :/

@dfr
Copy link
Contributor

dfr commented May 26, 2022

I never noticed this issue using runj with buildah and podmon which might suggest the problem is upstream from runj, perhaps in the containerd shim?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants