|
Bugzilla – Full Text Bug Listing |
| Summary: | terminal features | ||
|---|---|---|---|
| Product: | [openSUSE] SUSE Linux 10.1 | Reporter: | Forgotten User 7L3tOtZIov <forgotten_7L3tOtZIov> |
| Component: | Usability | Assignee: | Michael Loeffler <michl> |
| Status: | RESOLVED FIXED | QA Contact: | Siegfried Olschner <siegfried.olschner> |
| Severity: | Enhancement | ||
| Priority: | P5 - None | CC: | andreas.hanke, forgotten_3gCYeee-ni, hhetter, mrmazda, silviu_marin-caea, suse-beta, werner |
| Version: | Beta 3 | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | Other | ||
| Whiteboard: | |||
| Found By: | Other | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
| Attachments: | My personal ~/lib/share/sh.lib a library which uses terminfo and tput | ||
|
Description
Forgotten User 7L3tOtZIov
2006-01-21 15:48:11 UTC
What about http://www.cboltz.de/en/linux/bashprompt/ ? ;-) That or something else from the bash prompt howto. Having root with a red background could indeed already be a good idea. As long as the difference is much more clear as it is now. http://www.gilesorr.com/bashprompt/prompts/index.html has some nice ones as well. Others could be in company colors. Green for SUSE red for Novell. :-) Hmm, the idea with fontcolor is interesting. We have a color-blind developer here, I will ask for his mind. beta3 is still black and white. Any news about this? ;-) No news about this. Everyone is snowed under with works. Marco, Holger what do you think about such a feature? Being color-blind doesn't mean you can't see any colors, so it's no problem for me to have colored prompts. :) It's a good idea, you immediately see that root is working here. I would just color the font itself, and not the background of the characters. The "Inverted" style is IMHO really not nice. Yes. Just the font itself. Green for standard user. Red for root. Adding something like the following will make it easier for people to edit the colours: #Colors BLACK="\[\033[0;30m\]" GREY="\[\033[1;30m\]" BLUE="\[\033[0;34m\]" LBLUE="\[\033[1;34m\]" GREEN="\[\033[0;32m\]" LGREEN="\[\033[1;32m\]" CYAN="\[\033[0;36m\]" LCYAN="\[\033[1;36m\]" RED="\[\033[0;31m\]" LRED="\[\033[1;31m\]" PURPLE="\[\033[0;35m\]" LPURPLE="\[\033[1;35m\]" BROWN="\[\033[0;33m\]" YELLOW="\[\033[1;33m\]" LGREY="\[\033[0;37m\]" WHITE="\[\033[1;37m\]" NO_COLOUR="\[\033[0m\]" # Prompt PS1="$GREEN\u@\h : $NO_COLOUR" For Root obviously $RED instead of $GREEN Michl, do you need such a feature in the SL? Then you should create a section in FATE (and eventually request a Usability-Report ;-) pinging Careful not to over do it. The prompt should not be too noisy. For example I'm using the regular prompt but with a red # sign. echo $PS1 \h:\w \[\e[31m#\[\e[0m\]\] It should indeed not be too noisy. For root: PS1="\h:\w \[\e[31m#\[\e[0m\]\] " For user: PS1="\h:\w \[\e[1;32m:\[\e[0m\]\] " So just colours for respectivaly the '#' for root and the ':' for a user. It looks less agressive then having the whole prompt in Green/Red. It also still has the difference between # and : for root and user. No change in 10.2 Alpha 2 Ni change in Alpha 4. Sorry for the delay here. I added Werner who is the bash maintainer for his opinion on that. Created attachment 99614 [details]
My personal ~/lib/share/sh.lib a library which uses terminfo and tput
... with this library we do not depend on escape
sequences but use terminfo capabilities. My
root prompt looks like this
PS1="\\[$(tput bold; tput setaf 1)\\]\\h:\\W \\$ \\[$(tput sgr0)\\]"
IMHO colo(u)red prompts is a users feature and he/she should handle this. Nevertheless we could add the attachment to an appropiate location. Any suggesstions for the name and location in the system? I could argue that everything in KDE and GNOME is also user features. Also the alias for `ls` is something that could fit under the user features, It is not as if we will override user settings if they want to change it, just that it is clear what the difference is between User and Root and that in a subtle way. Especially for the user who does not use CLI often enough to know if or how to change these colors himself. If it would just be in bash, that would already be great, because people who use something else will surely be able to change it and this is a warning for people who are not that confident in CLI. So I would go for /etc/bash.bashrc. Look at comment 11 for a subtle example. Or else for /etc/skel/.bashrc or or /etc/profile or any (or some) of the /etc/profile.d/* files, I see that there are already some SUSE specific changes in /etc/profile, so this customisation should fit right in. The problem is: you will get some customers and users which will complain about such a change. I'm remembering on such complains about a few changes in /etc/bash.bashrc or /etc/profile and addons like /etc/profile.d/complete.bash One reason to avoid colored prompts which _is_ visible to the users. It _is_ indeed visible. That is the whole point. :-) I am sure that any chane will bring about complaints. For each change you will find people who will complain for whatever reason.The question you have to ask wether it is an improvement or not. I think it is. Just like you have different backgrounds in KDE for root and a different one for a user. Or the difference when opening Konsole (I think) in a different colour when opening as root. I know it saved me some stupid mistakes by seeing clearly that I was root and I would help preventing thse mistakes with others as well. All people I have met and asked do have edited the prompt to make it clear that they are root and almost all used a colour to do so. Beta 1 still does not contain this simple addition. KDE and GNOME are completely reworked and styled to SUSE norms and clearly have a difference between root and user. Why not with CLI? Please look at Comment 11, where an example of a very subtle change is proposed. Beta 2 still no colour. Even an ls gives colour and that is also not default. So please add this. Even getting a baby is faster then adding something this easy and usefull. Still nothing. Are we aiting for the 1 year celebration of this ticket? OK. Can we have it for 10.3? This is NOT rocket science. All it does is to make it clear wether you are running as root or as user, by using colour. This can be compared to linking colours to `ls`. The reason that some people might complain is not valid as long as you do other changes as well. Either you do change things for the better, or you don't. If there is no good reason to have colours, then remove them from the 'ls' as well. This is now more then a year old. I've added the lines
if test "$UID" -eq 0 -a -t && type -p tput > /dev/null 2>&1 ; then
_bred="$(tput bold 2> /dev/null; tput setaf 1 2> /dev/null)"
_sgr0="$(tput sgr0 2> /dev/null)"
PS1="\[$_bred\]$PS1\[$_sgr0\]"
unset _bred _sgr0
fi
to /etc/bash.bashrc
Bah, someone stole my idea! \[\e[1;30m\]\A \[\e[0;31m\]\h:$(beautify_path) \[\e[1m\]#\[\e[0m\] (aaa_base-10.2-38.jen4 and long before) I find it very useful to have a time prompt for each line. It provides me with a time scale of commands given. It's most useful as root, where you give some commands then you check the system logs for effects of those. With a time prompt, you can order cause and effect very clearly.
I have added a \t to _u in /etc/bash.bashrc in this section.
# Other prompting for root
_t=""
if test "$UID" -eq 0 ; then
_u="\t \h"
_p=" #"
else
_u="\t \u@\h"
Personally I have it for all users (in the "else" branch), but, as I said it's most useful for root. I don't expect this to be in 10.3, it's too late. Let people express opinions and add it perhaps in the next version, if those opinions are positive.
Please use /etc/bash.bashrc.local for such changes. IMHO it makes no sence to add personal preferences to /etc/bash.bashrc The addition of this "feature" has caused issues with all of our prior deployed login session expect scripts. Please don't put "pretty" or "helpful for the clueless" enhancements into Enterprise Server builds in the future. I agree this should be reverted. The comment 25 section could be left in with appropriate comments for those who think that this was a good idea. For me and others who use black text on white background in Konsole, a red on white prompt isn't much better than a white on white prompt. ls produces colors. So colors are to be expected on openSUSE terminals. And this is NOT about being "pretty" but to give the user an extra alert when he is logged in as root. As far as SLE goes, I am purely talking about openSUSE and have no experience with SLE, so no comment there as I also have no idea in how far that is Vanilla, i.e. no adaptions to /etc/bash.bashrc and no colours with ls. I do understand if the people would want no adaption at all. However that should be discussed in the aproprate place and not on the openSUSE part. I also have no idea why this would come up suddenly after several years of it being used in openSUSE without any complaints. Such "helpful for the clueless" enhancement are and were part of all SLES versions out there and only active for interactive shells. That is that a login session using a script instead of a login shell do not use them. Beside this not only users openSUSE but also customers of SLES products had contribute such enhancements. The core source part of SLES and openSUSE are identical. After a release has happen the source tree of the specific product will be maintained on this state. Outing myself as one of the "clueless" then, it helps me a lot when I work in tabbed terminals while programming. it just makes my recognition of "here is the root window" a few milliseconds faster. I like it. |