How do the people of Jow Forums setup their bash prompt?

How do the people of Jow Forums setup their bash prompt?

Attached: 1520552708087.png (374x475, 39K)

Other urls found in this thread:

github.com/yarisgutierrez/classyTouch_oh-my-zsh/blob/master/classyTouch.zsh-theme
github.com/zsh-users/fizsh
marc.info/?l=openbsd-tech&m=151284802201397&w=2
ix.io/1hgt
twitter.com/NSFWRedditGif

Is there any reason to use other shell than zsh?

I live under a rock, what's so good about zsh?

Attached: 1523728913992.jpg (429x377, 41K)

Attached: Screen Shot 2018-07-14 at 1.30.25 p.m..png (86x37, 4K)

/usr/bin/ksh93

I just use fish
Dunno why
It's kinda bloated but whatever

Attached: SAMHYDEBURN.jpg (639x960, 47K)

By planting false evidence.

Attached: CopyQ.kn3271.png (858x488, 47K)

Watcha got going on there?

On one machine I've got that fork of zsh-pure that improves git support and replaces the onions unicode > thingy with an $ by default, on the other I have a prompt that displays my pwd, but replacing all the slashes with backslashes, adding "C:" at the start and with ">" as the prompt character, which is a leftover from when I riced everything with Chicago95.

like this

Attached: 2018-07-14-125003_956x1047_scrot.png (956x1047, 61K)

oh-my-zsh with powerline

;)

It makes easy to add cool plugins, that higligh syntax, show hints etc. That is kind of a fish feel, but less bloated, faster and has got more typical syntax.

like this

Attached: screenshot.png (1313x432, 50K)

PS1="\$ "

I use classyTouch
github.com/yarisgutierrez/classyTouch_oh-my-zsh/blob/master/classyTouch.zsh-theme

local current_dir='%{$fg[red]%}[%{$reset_color%}%~% %{$fg[red]%}]%{$reset_color%}'
local git_branch='$(git_prompt_info)%{$reset_color%}'


PROMPT="%(?,%{$fg[red]%}┌─╼${current_dir}%{$reset_color%} ${git_branch}
%{$fg[red]%}└────╼%{$reset_color%} ,%{$fg[red]%}┌─╼${current_dir}%{$reset_color%} ${git_branch}
%{$fg[red]%}└╼ %{$reset_color%} "

ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}["
ZSH_THEME_GIT_PROMPT_SUFFIX="] %{$reset_color%}"

Muhahaha I can't find who translated this image but I can undisputedly tell that it's literally translated from japanese
"RL-fags, explode" -> リア充爆発しろ
That's so half-assed, their could just write "Die, normies"

It's a really easy way to join the cargo cult of fancy prompts while offering no real advantages over bash.

nothing

way better tab autocompletion with ohmyzsh

sudo pacman -Syu fish
chsh -s /usr/bin/fish

busybox'es ash

37820
36902

I've made some observations about people who use zsh and I know why most of them think it's better than bash.

People switch to zsh either to be special snowflakes or because they see cool zsh prompts in desktop threads or because they hear it has better completion (I personally don't think it does).
Most of them have no idea that the same look can be achieved with bash, that you can embed commands into your PS1, they probably haven't heard of PS2, PS3 and PS4 and they probably don't even know what readline is.
They haven't heard of inputrc, they don't know how to add custom keybinds to macros in bash, they don't know that you can change the editing mode of the interactive shell to be Vi-like.
They don't know about incremental search nor do they know about different completion settings.

Some may say that it's better for scripting, but scripting in a non standard shell is pointless, since you still need to know POSIX scripting and in most cases bash, since it has more features than sh and unlike zsh it's everywhere.
If you want to use a sane language for scripting, use python or if you're working on a larger project, you might also want to consider using a non interpreted programming language like C.

Zsh users are mostly ignorant impresionable people, hipsters of all sorts including nu-male macfag webdev sitting at starbucks types and most of them like to pretend to be cool for using a non standard shell while barely having scratched the surface of bash/readline and I do not want to be associated with them in any way.
In order to make an informed decision about which shell to use, you've got to at least know the basics of both shells and what readline is and what you can do with it.

I personally don't see a valid reason to switch to zsh. I think zsh is bloat mostly for the sake of it.
There might be valid reasons to use zsh, but most people certainly don't do it for valid reasons.

>zshfags

Attached: >zshfags.png (798x520, 226K)

Why use fish, zsh, or bash if fizsh exists? It supports bourne syntax unlike that disaster known as fish. It still supports oh-my-zsh. It's the only shell that checks all of the boxes you anons want. If you're not color blind and you don't want to spend a million hours setting up your terminal like is suggesting, then get it. github.com/zsh-users/fizsh

Also : get out more. Nobody uses zsh for scripting and if you're complaining about muh POSIX scripting, don't use bash. Unless you're writing your scripts in pure bourne shell, you're not writing a POSIX-compliant script. All of the features you talked about are available in zsh/fizsh, and yes, it does have better completion (and matlab-like history search, if you're using fizsh). Nice pasta though.

>it does have better completion
t. Arch user
Bash has better completion than fish and zsh combined on any distro that packages bash completion scripts.

B A S E D

pdksh: \!: [\h:\u:\w]\$

haha btfo

Holy shit lol fucking got 'em

>and yes, it does have better completion
You know, just entering the next character is much more efficient than pressing tab until you finally get the result you want.
If you can actually type, that is.

Friendly reminder that real men include the hostname in their prompt.

marc.info/?l=openbsd-tech&m=151284802201397&w=2

:)

Attached: kill.gif (1920x1080, 1.13M)

only adults can post in this thread namefag

Based.

export PS1="\u@\h::\w\n::λ "

Attached: 1530484003478.png (1422x1275, 205K)

Pure sh with nothing on it

Attached: cowsay.png (382x275, 9K)

>unicode in PS1
shiggy

also lambda looks stupid on my terminal font. furthermore, I literally NEVER want to see the hostname in my prompt
coff=$(tput sgr0) # Color off
cgreen=$(tput setaf 2)
cblue=$(tput setaf 4)

PS1='\[$cblue\]\w\[$coff\] \[$cgreen\]\$ \[$coff\]'; export PS1

>there were no men before the advent of computing
>you have to be a sysadmin techsupport nigger running "apt-get update && apt-get upgrade" cronjobs on 50+ remote machines to be a "real man"
nerds have funny notions of masculinity

>>unicode in PS1
>shiggy
it works fine in my environment, which is shell-mode on emacs
>also lambda looks stupid on my terminal font.
get a better font then
>furthermore, I literally NEVER want to see the hostname in my prompt
why? I want to see if I'm ssh-ing somewhere

Attached: 2018-07-15-062025_253x41_scrot.png (253x41, 3K)

>why? I want to see if I'm ssh-ing somewhere
You realize you can (and often is the default) use the PS1 defined on the remote machine for that, right?

cp /etc/skel/.bashrc ~/
that's pretty much it.

Attached: 1530614783646.jpg (750x746, 97K)

Don't need anything fancy. This will suffice with a hook for git repositories.

Also, used to use zsh but switched to fish because it requires no real configuration and is nicer to use in an interactive setting.

Attached: 2018-07-15-222838_154x76_scrot.png (154x76, 364)

>get a better font then
but my font looks excellent for all the usecases of my everyday terminal life (mostly latin, CJK and a bit of cyrillic. in my experience, only pretentious fags use greek letters on the computer, no offense)

[ $RANDOM -gt 16384 ]&&9 rc||mksh

>only pretentious fags use greek letters on the computer, no offense
B-but what if I'm Greek?

Attached: pepe_serious.jpg (247x204, 9K)

> Some may say that it's better for scripting, but scripting in a non standard shell is pointless, since you still need to know POSIX scripting and in most cases bash, since it has more features than sh and unlike zsh it's everywhere.
When writing scripts for others, obviously I use POSIX. So what shell I use makes zero difference. But when writing scripts purely for myself, I can take advantage of zsh features.

For instance, I can just use my shell as a calculator, which is really convenient because I almost always have several terminal windows open. POSIX compliance has absolutely no bearing on trying to calculate "echo $((103/7))".

Pic related.
If you want the simple version, just use this
PS1="┌─╼ \[\e[0;34m\]\u\[\e[1;35m\]::\[\e[0;34m\]\h \[\e[1;34m\]\w\[\e[0m\]\n└────╼ "

I'm using Vi editing mode in bash, this └[ins] is not actually part of the PS1 string, it's the mode indicator string (tells me whether I'm in insert mode or command (normal) mode).
You can set Vi editing mode for bash in .bashrc like so
bind 'set editing-mode vi'

And then this to get the indicator:
bind 'set show-mode-in-prompt on'

And to change the indicator strings (I use these in bash):
bind 'set vi-ins-mode-string └[\1\e[34;1m\2ins\1\e[0m\2]'
bind 'set vi-cmd-mode-string └[\1\e[35;1m\2cmd\1\e[0m\2]'

If you want to use those, then use this PS1:
PS1="┌─╼ \[\e[0;34m\]\u\[\e[1;35m\]::\[\e[0;34m\]\h \[\e[1;34m\]\w\[\e[0m\]\n──╼ "

If you want to use the Vi editing mode in all programs that use the GNU readline library (it's the library that processes your input on the command line, the Vi editing mode is actually a feature of readline, not of bash) like python, fdisk and whatnot, you need to set the previous things up in ~/.inputrc like so
$include /etc/inputrc
set editing-mode vi
set show-mode-in-prompt on

I kept the mode string definitions that I use with my PS1 in bash in my .bashrc (settings in .bashrc override the settings in .inputrc) and put some neutral mode strings in .inputrc that don't look out of place w/o my bash PS1 in other programs that use readline besides bash, here they are:
set vi-ins-mode-string [\1\e[0;32m\2>\1\e[0m\2]
set vi-cmd-mode-string [\1\e[0;32m\2:\1\e[0m\2]

Attached: 2018-07-15-165202_622x398_scrot.png (622x398, 13K)

I also made it so my PS1 (the one I use in X terminals) changes when I enter my anime directory, so if you want that, your PS1 turns into this:
PS1="┌─╼ \$(if [[ \$PWD/ = \$HOME/anime/* ]]; then \
echo \"\e[1;35m(\e[0;35m •\e[1;35m^ ω ^) \e[1;34m\$(pwd | sed 's|'"$HOME"'/anime/\{0,1\}|アニメ |')\e[m\"; \
else \
echo \"\e[0;35m\u\e[1;36m::\e[0;32m\h \e[1;34m\w\e[m\"; \
fi)\n──╼ "

Finally, I use a completely different PS1 and mode strings in my ttys and tmux/screen/non X terminals because some characters from the one I use for X terminals are unicode and can't be displayed properly in the tty:
bind 'set vi-ins-mode-string \1\e[0;35m\2╚╡\1\e[0;32;7m\2>\1\e[0;32m\2▓▒░\1\e[0m\2'
bind 'set vi-cmd-mode-string \1\e[0;35m\2╚╡\1\e[0;32;7m\2:\1\e[0;32m\2▓▒░\1\e[0m\2'
PS1="\e[0;35m╔═╡\e[1;34m\h\e[0;35m╞═╡\e[1;34m\$(tty | cut -d "/" -f 3-)\e[0;35m╞═╡ \e[1;34m\w\e[m\n "

These look really cool and interesting imo and make my tty way less boring and also as you can see in the second field it displays the tty I'm currently in, which is pretty useful.

So, the final code for my prompts is this:
if [ ! $TERM = linux ] && [ ! $TERM = screen ]; then
#█▓▒░ Vi editing mode indicators and PS1/2 for regular X terminals

bind 'set vi-ins-mode-string └[\1\e[34;1m\2ins\1\e[0m\2]'
bind 'set vi-cmd-mode-string └[\1\e[35;1m\2cmd\1\e[0m\2]'

PS1="┌─╼ \$(if [[ \$PWD/ = \$HOME/anime/* ]]; then \
echo \"\e[1;35m(\e[0;35m •\e[1;35m^ ω ^) \e[1;34m\$(pwd | sed 's|'"$HOME"'/anime/\{0,1\}|アニメ |')\e[m\"; \
else \
echo \"\e[0;35m\u\e[1;36m::\e[0;32m\h \e[1;34m\w\e[m\"; \
fi)\n──╼ "

PS2=" "
else
#█▓▒░ Vi editing mode indicators and PS1/2 for the tty and screen/tmux

bind 'set vi-ins-mode-string \1\e[0;35m\2╚╡\1\e[0;32;7m\2>\1\e[0;32m\2▓▒░\1\e[0m\2'
bind 'set vi-cmd-mode-string \1\e[0;35m\2╚╡\1\e[0;32;7m\2:\1\e[0;32m\2▓▒░\1\e[0m\2'
PS1="\e[0;35m╔═╡\e[1;34m\h\e[0;35m╞═╡\e[1;34m\$(tty | cut -d "/" -f 3-)\e[0;35m╞═╡ \e[1;34m\w\e[m\n "
PS2=" "
fi

plus the bits that are in my .inputrc

by editing .bashrc in a text editor

These are really cool, user.
Thanks for sharing.
t. OP

Attached: 1333059747360.png (237x237, 28K)

np, also, here's the rest of my inputrc ix.io/1hgt
you may or may not find it useful

neat