2

Based on: Terminal output scrolling is gone (Headless 11.10 Server, Upgraded from 10.10)
and
https://superuser.com/questions/1331658/why-cant-i-scroll-in-the-terminal and my own dire situation right now.

What I did before the problem occurred?

I'm running this tor relay on a VPS, and I'm monitoring it using nyx tor monitor. I'm connecting to this VPS from my home based laptop, running Ubuntu 22.04, totally updated version.

For the first time I was trying the nohup command run against nyx tor monitor.
I just wanted nyx to survive terminal disconnect (from my local Ubuntu 22.04 laptop), and be able to close the laptop, turn it back on again, ssh into my tor and nyx running VPS and bring back nyx from the background, instead of turning it on after the VPS login.
I've run nohup nyx & and then my problems started. I've got the nohup output:

rafal@debian:~$ nohup nyx &
[1] 4532
rafal@debian:~$ nohup: ignoring input and appending output to 'nohup.out'

Why ignoring input??
I need to pass the nyx password. How am I to do this without the input or while input is ignored.
How am I supposed to check if nyx even launched without a password or not?? I've typed fg and now I can type the nyx password.
So I type the password and press Enter but nothing happens. I can see no input.

When I use jobs command, I get no output in return.

What's wrong?

  1. Shift+PgUp writes 2~ on the command line instead of scrolling,
  2. Ctrl+Shift+ writes A on the command line instead of scrolling,
  3. Terminal on my home laptop shows only 24 rows, no matter what command I'll throw at it: history shows only 24 rows; cat -n /home/rafal/nohup.outor another command with a long output, px -aux shows only 24 rows;

enter image description here

enter image description here

  1. The scrollbar on the right fills the entire vertical height of the window, indicating that there's nothing to scroll back to, while there are actually hundreds of lines above;
  2. Turning the mouse wheel cycles the current line through my command history (same as UP key) instead of scrolling.
  3. Of course I have 10 000 lines set in my gnome_terminal settings.

The question

Can you please tell me what exactly happened and what ignoring input means and why nohup ignores input by default??

rafal@debian:~$ nohup nyx &
[1] 4532
rafal@debian:~$ nohup: ignoring input and appending output to 'nohup.out'

I'm not using tmux.

In order to reinitialize the terminal, I've used reset to fix this. And it did fix terminal. Now after I use px -aux command I get full window height of lines like so:

enter image description here

Can you please explain to me, what am I doing wrong with this nohup nyx & command, that it's not working the way I expect it to??

2
  • 1
    "... ignoring input ..." because the process running your command is detached from the current terminal and its STDIN is no more tied to this terminal so can't receive input from it anymore ... The output, however, is added by default to a file nohup.out in the current working directory and you should be able to read it as it's added with something like tail -f nohup.out
    – Raffa
    Commented Dec 8, 2023 at 12:04
  • For reference, another possible cause of stuck/changed scrolling behaviour is the terminal getting stuck with the alternate screen buffer.  Some programs such as vim switch the terminal to use an alternate screen buffer, so that you get your original screen back when it exits — but if it aborts/crashes without restoring the original buffer, the terminal can behave strangely.  (One workaround is simply to start and then exit vim.)
    – gidds
    Commented Dec 9, 2023 at 0:00

2 Answers 2

3

This is just how nohup works. It is designed to run a process in the background, detached from your shell session and will not accept input and by default sends output to nohup.out.

However, you want to use it to run an interactive monitor, so nohup is the wrong tool for the job. Just use tmux or screen instead. Run nyx inide the tmux/screen session, and then you can close the terminal or your laptop, ssh back to your VPS, start tmux/screen again and you're right back where you started.

2

This is an addition to @terdon's answer, not a replacement for that.

Most terminal emulators have a "normal screen" and an "alternate screen". The latter one doesn't have a scrollback buffer, and is typically used by fullscreen apps. Apparently nyx is also such an application that switches to the alternate screen, that's why you cannot scroll.

Several terminals, including GNOME Terminal that you're using, send the keycodes of Shift+PageUp and friends (the scrolling keycombos) to the running application if you're on the alternate screen.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .