Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE SUGGESTION] Bash Terminal Colours #6

Closed
BadCo-NZ opened this issue Feb 16, 2022 · 4 comments
Closed

[FEATURE SUGGESTION] Bash Terminal Colours #6

BadCo-NZ opened this issue Feb 16, 2022 · 4 comments

Comments

@BadCo-NZ
Copy link
Contributor

Hi, I recently setup a second node and came across a few things that might be useful to add to the Toolbox

First up, is terminal colours! I'm not a fan of how stock Debian keeps everything the same, but I am a fan of how Turnkey Linux has theirs setup.

This can be done by editing bash.rc

nano /etc/bash.bashrc

Before: From Line 18

# set a fancy prompt (non-color, overwrite the one in /etc/profile)
# but only if not SUDOing and have SUDO_PS1 set; then assume smart user.
if ! [ -n "${SUDO_USER}" -a -n "${SUDO_PS1}" ]; then
  PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi

After:

# set a fancy prompt (non-color, overwrite the one in /etc/profile)
# but only if not SUDOing and have SUDO_PS1 set; then assume smart user.
if ! [ -n "${SUDO_USER}" -a -n "${SUDO_PS1}" ]; then
    eval "`dircolors -b`"
    alias ls='ls --color=auto'
    alias ll='ls --color=auto -alF'
    alias la='ls --color=auto -A'
    alias l='ls --color=auto -CF'
    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'

    # Set a terminal prompt style (default is fancy color prompt)
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;33m\]\u@\h \[\033[01;34m\]\w\[\033[00m\]\$ '
else
    alias ls="ls -F"
    alias ll='ls -alF'
    alias la='ls -A'
    alias l='ls -CF'
    PS1='${debian_chroot:+($debian_chroot)}\u@\h \w\$ '
fi
@Tontonjo
Copy link
Owner

Hi!

Thanks for your suggestions.
I'm not sure this could be a very usfull add as this is more globally related to any terminal connexions and i'm feeling it would just lead to add complexit where there are already enough.
I'd like to keep this script the more "proxmox features" related as possible

that said, On my side, i have no needs for such things as my software already does a coloring job aswell.

This may take place in a more "general debian configurations" tool.

i may leave this open if there are other ppl interested or other arguments, i may reconsider my point

@BadCo-NZ
Copy link
Contributor Author

Hi @Tontonjo, you make some good points, yes it isn't Proxmox specific but more underlying OS (Debian) specific, I still think it would be useful though :)

What terminal emulator are you using that does bash colouring well?

Any stock ones I have tried (Gnome Terminal and Manjaro KDE Konsole) just colour either everything (Konsole) or just the prompt.

@Tontonjo
Copy link
Owner

I'm using Moba Xterm on Windows.
Again, i dont think i want this kind of features atm.
May think about another tool.

@Tontonjo
Copy link
Owner

Not enough Proxmox related to me at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants