Skip to content

Instantly share code, notes, and snippets.

@lzlrd
Created September 8, 2021 16:29
Show Gist options
  • Save lzlrd/c34c8ad750100499128f4a4cb0dd750d to your computer and use it in GitHub Desktop.
Save lzlrd/c34c8ad750100499128f4a4cb0dd750d to your computer and use it in GitHub Desktop.
The shell prompts I use for my client and server devices.

Client

Normal

export PS1="\[$(tput setaf 2)\]┌──(\[$(tput setaf 4)\]\u@\h\[$(tput setaf 2)\])-[\[$(tput sgr0)\]\w\[$(tput setaf 2)\]]\n└─\[$(tput setaf 4)\]\\$\[$(tput sgr0)\]\[$(tput sgr0)\] "

Root

export PS1="\[$(tput setaf 4)\]┌──(\[$(tput setaf 1)\]\u@\h\[$(tput setaf 4)\])-[\[$(tput sgr0)\]\w\[$(tput setaf 4)\]]\n└─\[$(tput setaf 1)\]\\$\[$(tput sgr0)\]\[$(tput sgr0)\] "

Server

Normal

export PS1="\[$(tput setaf 2)\]$(echo -n "4pSM4pSA4pSA" | base64 --decode)(\[$(tput setaf 4)\]\u@$(hostnamectl --pretty)\[$(tput setaf 2)\])-[\[$(tput sgr0)\]\w\[$(tput setaf 2)\]]\n$(echo -n "4pSU4pSA" | base64 --decode)\[$(tput setaf 4)\]\\$\[$(tput sgr0)\]\[$(tput sgr0)\] "

Root

export PS1="\[$(tput setaf 4)\]$(echo -n "4pSM4pSA4pSA" | base64 --decode)(\[$(tput setaf 1)\]\u@$(hostnamectl --pretty)\[$(tput setaf 4)\])-[\[$(tput sgr0)\]\w\[$(tput setaf 4)\]]\n$(echo -n "4pSU4pSA" | base64 --decode)\[$(tput setaf 1)\]\\$\[$(tput sgr0)\]\[$(tput sgr0)\] "
@lzlrd
Copy link
Author

lzlrd commented Sep 8, 2021

Why did I use Base64 I hear you ask? Well OpenSSH (at least on Windows via Windows Terminal) translates ┌── to ^t^l ^t^` ^t^ and Linux isn't a fan of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment