lxqt / qtermwidget

The terminal widget for QTerminal
https://lxqt.github.io
GNU General Public License v2.0
494 stars 253 forks source link

[feature request] change tab color and label when running as root/su #507

Open drkmc opened 1 year ago

drkmc commented 1 year ago

It is helpful to remind users when they have a tab open as root/running su. A second use case is to help users who are working on several hosts or directories remember which tab is used for a task.

Expected Behavior

Changing the tab color (e.g. red with white letters), perhaps prefixing the tab name with some reminder (e.g. on my root user's BASH prompt, before the current time is ⚠) and/or changing the background (I don't recall which terminal used to have a lit mortar round "bomb" when you logged in as root, but it was a hard to miss environmental clue) and/or just listing the current user (as Konsole lets you do--I like being able to show the directory or other data on the tab as it helps) would be very helpful.

Current Behavior

You can change the tab name by hand, but if you are the sort who remembers to do this on a regular basis, you probably don't need this feature.

Possible Solution

Echoing current BASH environment data (e.g. host, user (e.g. output of whoami), directory (pwd), what's running in the foreground, etc.) info like how konsole does it would be a partial and welcome addition. Linking a profile to the current effective user would be an option.

Steps to Reproduce (for bugs)

N/A

Context

$ su

$ mkdir mystuff
$ tar -xvzf archive.tar.gz mystuff/

# cd mystuff
bash: cd: mystuff: No such file or directory

🤬

# su
$ chmod ....
System Information