Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: Stop CLEARing TTY screen (Read 1279 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Stop CLEARing TTY screen

After 4/12/2025 upgrade on a computer, the next computers later timeframe  the upgraded with  -Syu and reboot
would "CLEAR"  tty1. [could stop systemD from doing that]
None of my 8 systems run a DM. Did a search at artix and bbs.archlinux for clear in subject
 TRied to modify /etc/init.d/agetty [line 17 ] command=/sbin/agetty -J
Rebooted agetty would not start, booted flash to take the -J off to start agetty.
  When i end session on tty with cntl-d always has cleared tty?

Re: Stop CLEARing TTY screen

Reply #1
You can set noclear in /etc/conf.d/ agetty.tty1 (or whatever tty number is applicable for you) with a line like this adding noclear and any other additions you might want inside the "" with a space between them:
Code: [Select]
# extra options to pass to agetty for this port
agetty_options="--noclear"
Not sure if that is what you are looking for?

Re: Stop CLEARing TTY screen

Reply #2
Could not  find /etc/conf.d, used /etc/init.d/agetty  [line 18]
command_args_foreground="${agetty_options} ${port} ${baud} ${term_type} --noclear "
that fixed all of the ttys
Thank you

Re: Stop CLEARing TTY screen

Reply #3
/etc/conf.d is present when using OpenRC, but other  inits may have different  ways of doing this. You may encounter difficulties on upgrades if you modify system files. Check what package owns the file using pacman -Qo /etc/init.d/agetty then locate the PKGBUILD for the package, OpenRC is here for example:
https://gitea.artixlinux.org/packages/openrc/src/branch/master/PKGBUILD
You will see a section starting:
backup=(
which contains the files which you can modify as they will not be overwritten and a .pacnew file created instead. Other files in a package will be replaced on any update of the package in question, along with your modifications.

Re: Stop CLEARing TTY screen

Reply #4
Yes my 6 computers with openrc have /etc/conf.d BUT some  updated in April/2025
The different was /etc/conf.d/agetty.tty1  had option=-J  /* same as --noclear */
Other agetty.tty[2-6] had NO  -J , now all have no -J  after n update!
Just thought pacman would create .pacnew  on upgraded  file if different then current, O'WeLL

Re: Stop CLEARing TTY screen

Reply #5
It did create a pacnew file on my system, only agetty.tty1 was modified by me:
Code: [Select]
$ ls -lh /etc/conf.d
...
-rw-r--r-- 1 root root  196 Apr 29 21:04 agetty
-rw-r--r-- 1 root root  274 Jun 20  2024 agetty.tty1
-rw-r--r-- 1 root root  196 Apr 29 21:04 agetty.tty1.pacnew
-rw-r--r-- 1 root root  196 Apr 29 21:04 agetty.tty2
-rw-r--r-- 1 root root  196 Apr 29 21:04 agetty.tty3
-rw-r--r-- 1 root root  196 Apr 29 21:04 agetty.tty4
-rw-r--r-- 1 root root  196 Apr 29 21:04 agetty.tty5
-rw-r--r-- 1 root root  196 Apr 29 21:04 agetty.tty6
...
I don't know why it didn't for you?

Re: Stop CLEARing TTY screen

Reply #6
Tried changes to Laptop, that did not have the openrc upgrade
changed /etc/conf.d/agetty1-6 to NOT clear  screen
On upgrade,  getty[1-6]  got pacsave files also.
Then found at the end of  /var/lib/pacman/local/openrc/files
files set for backup for  openrc

Re: Stop CLEARing TTY screen

Reply #7
That's good, happy it is working for you. There have been a couple of recent changes to the backup section in the OpenRC PKGBUILD:
 https://gitea.artixlinux.org/packages/openrc/commit/23589142cfd151516a48719e46a89d24524635bd
https://gitea.artixlinux.org/packages/openrc/commit/d59c8d558ad6ab549e55006f366d13a79f8f013b
It didn't look like there were any typos introduced though, and the files file seems to confirm they will be backed up if needed.