[GH-ISSUE #7316] feat: Clear terminal screen on logout #1558

Closed
opened 2026-02-26 12:49:26 +03:00 by kerem · 5 comments
Owner

Originally created by @dp20eic on GitHub (Aug 31, 2025).
Original GitHub issue: https://github.com/community-scripts/ProxmoxVE/issues/7316

🌟 Briefly describe the feature

Installs a logout script to automatically clear the terminal history, ensuring a clean slate after each session.

📝 Detailed description

This feature request aims to improve user experience by automatically clearing the terminal screen when logging out.

💡 Why is this useful?

Motivation:

When a user logs out, of an SSH session or local console, previous commands and output often remain visible. This can pose a security risk, especially if confidential information such as IP addresses, user names, or configuration details are visible in the screen history.
Automatically clearing the screen ensures a “clean” state and protects user privacy and system information.

Implementation suggestion:

Please add a function to the helper scripts that creates or updates the file /etc/bash.bash_logout with the following content:

sleep 1
clear

With kind regards
Bernd

Originally created by @dp20eic on GitHub (Aug 31, 2025). Original GitHub issue: https://github.com/community-scripts/ProxmoxVE/issues/7316 ### 🌟 Briefly describe the feature Installs a logout script to automatically clear the terminal history, ensuring a clean slate after each session. ### 📝 Detailed description This feature request aims to improve user experience by automatically clearing the terminal screen when logging out. ### 💡 Why is this useful? **Motivation:** When a user logs out, of an SSH session or local console, previous commands and output often remain visible. This can pose a security risk, especially if confidential information such as IP addresses, user names, or configuration details are visible in the screen history. Automatically clearing the screen ensures a “clean” state and protects user privacy and system information. **Implementation suggestion:** Please add a function to the helper scripts that creates or updates the file `/etc/bash.bash_logout` with the following content: ``` sleep 1 clear ``` With kind regards Bernd
kerem 2026-02-26 12:49:26 +03:00
Author
Owner

@MickLesk commented on GitHub (Aug 31, 2025):

As seperate Script?

<!-- gh-comment-id:3240114975 --> @MickLesk commented on GitHub (Aug 31, 2025): As seperate Script?
Author
Owner

@michelroegl-brunner commented on GitHub (Aug 31, 2025):

i guess he means on any script, as a default. But i am not sure if this is really nessecary. SSH you dont have that issue, for the rest you need access to the pve node itself.

<!-- gh-comment-id:3240123900 --> @michelroegl-brunner commented on GitHub (Aug 31, 2025): i guess he means on any script, as a default. But i am not sure if this is really nessecary. SSH you dont have that issue, for the rest you need access to the pve node itself.
Author
Owner

@dp20eic commented on GitHub (Sep 1, 2025):

Moin,

As seperate Script?

as I wrote it is only a smal file inside /etc -> /etc/bash.bash_logout with only two lines of code

sleep 1
clear

SSH you dont have that issue
That is not true, if I log in via ssh, and logout, all old information is shown.
Image

With kind regards
Bernd

<!-- gh-comment-id:3241415319 --> @dp20eic commented on GitHub (Sep 1, 2025): Moin, > As seperate Script? as I wrote it is only a smal file inside `/etc` -> `/etc/bash.bash_logout` with only two lines of code ``` sleep 1 clear ``` > SSH you dont have that issue That is not true, if I log in via ssh, and logout, all old information is shown. <img width="956" height="951" alt="Image" src="https://github.com/user-attachments/assets/b921cbd5-cc2d-41b3-abf9-dd1e0989372b" /> With kind regards Bernd
Author
Owner

@MickLesk commented on GitHub (Sep 1, 2025):

I'm not a fan of it; hundreds of thousands of people use it. Many of them are inexperienced. I also see little to no benefit in it.
Many administrators continue to scroll in the buffer after logging out (copy/paste of output). An automatic clear or even terminal reset destroys this.
“clear” usually only deletes the visible area; the scrollback of the terminal emulator often remains intact. This is not real protection.
We have Bash login shells, tmux/screen, serial consoles, various TERM types. Blind writing to STDOUT when logging out can, in rare cases, leave ugly escape sequences in logs/pipes.
and at least this Only applies to Bash login shells (/etc/bash.bash_logout). Alpine/ash & zsh/fish would be unaffected → inconsistent behavior.

<!-- gh-comment-id:3241633523 --> @MickLesk commented on GitHub (Sep 1, 2025): I'm not a fan of it; hundreds of thousands of people use it. Many of them are inexperienced. I also see little to no benefit in it. Many administrators continue to scroll in the buffer after logging out (copy/paste of output). An automatic clear or even terminal reset destroys this. “clear” usually only deletes the visible area; the scrollback of the terminal emulator often remains intact. This is not real protection. We have Bash login shells, tmux/screen, serial consoles, various TERM types. Blind writing to STDOUT when logging out can, in rare cases, leave ugly escape sequences in logs/pipes. and at least this Only applies to Bash login shells (/etc/bash.bash_logout). Alpine/ash & zsh/fish would be unaffected → inconsistent behavior.
Author
Owner

@CrazyWolf13 commented on GitHub (Sep 1, 2025):

Agreed with @MickLesk.

This is not something that we as community-script should tackle as this is pure user preference.
I and I'm sure many other Sysadmins often scroll up in the terminal to check things after logout or copy a command etc.

But this would be a good idea for some ansible automation from your side as this is pure user preference, and we can't make it right for everyone though we try to keep it as "vanilla" as possible.

<!-- gh-comment-id:3242044550 --> @CrazyWolf13 commented on GitHub (Sep 1, 2025): Agreed with @MickLesk. This is not something that we as community-script should tackle as this is pure user preference. I and I'm sure many other Sysadmins often scroll up in the terminal to check things after logout or copy a command etc. But this would be a good idea for some ansible automation from your side as this is pure user preference, and we can't make it right for everyone though we try to keep it as "vanilla" as possible.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ProxmoxVE#1558
No description provided.