

Important notice on readability before we start: During this part of the post I will use the same convention used in the documentation, and here’s the gist of it. In this part I will try to explain what goes where and why Part Two: Making sense of the visual noise I did find a guy by the name of Dylan Cali who made a forked version of Bash that supports placing these strings elsewhere in the prompt.

What I ended up doing what making a multiline prompt that ends in a newline, that way the entire last line was up for grabs, because unfortunately these mode strings only show up at the beginning of the last line of the prompt.

I have some unicode chracters that won’t transfer properly here so I swapped them for “u” in the above snippet.Īnother thing I want to point out is that I use Oh My Posh for my custom prompt, which proved to be a bit of a challenge. Set vi-ins-mode-string \1\e1337 SetColors=curbg=bffe21\e\\\2 # This needs to end with a literal backslash and therefore we specify \e\\ at the end before finally closing with a \2 # Our key is the cursor background (If you ask me it should be called the # This is a proprietary iTerm2 OSC ,Let's break it down: # \1\e[5 q\2 - Change cursor shape to blinking bar # \1\e[38 5 064m\2 - Set foreground color to 24-bit color #bffe5d # \1\e[38 5 015m\2 - Set foreground color to 8-bit color 015 (white) # Note that the multiple \1s and \2s aren't necessary and are only specified # \e] - Signal OSC (Operating System Command) # \e[ - Signal CSI (Control Sequence Introducer) # \e - By itself simply means "an escape character" You need to edit 2 file, add the following line to your ~/.bashrc\ ~/.bash_profile: set -o viĪdd the following to your ~/.inputrc (you can skip the comments, obviously): # Enable vi keybindings in bash Let’s start from the end – customizing the shell to show us what mode we’re currently in. A detailed list of sources is provided at the end of the post.īefore we start I would like you to know that this post is split into 2 parts, the first part is where I’ll show you what I put in my dotfiles to solve my issue, and the second part will be a deeper dive into the mechanisms in play. Good thing I did because man are those documents scattered across the internet. Now, these questions did have answers on what needs to be done, but I was astonished by the lack of proper documentation and explanation of what the helm all these characters mean, that I decided to hit the books. Seeing a bunch of old(ish) Stack Overflow questions about the subject, for example, this, this and this, felt reassuring to know that I’m not alone in this requirement. I wanted to look for a way to visually tell the mode I’m in, and so, of course, I took to Google. There was one problem though – I could never really know which mode I’m currently in. bash_profile file, I could use vi-like keybindings in Bash, and move between vi-command and vi-insert modes, just like in vi/vim. I found out that by putting set -o vi in my.
ESCAPE SEQUENCES PROFESSIONAL
I’ve seen people 7 times more professional than me and after attending an internal talk by Rafael Bodill, seeing his NeoVim configuration, I have decided to try switching to Vim as my main tool for writing code. It all started when I began working as a DevOps engineer at Tikal Knowledge. The hexadecimal number can be from 1 to 6 digits long.This might just be my longest post to date.

ESCAPE SEQUENCES CODE
( Unicode mode only) Represents the character with the given hexadecimal Unicode code point. Character class escape: \d, \D, \w, \W, \s, \S.Enumerability and ownership of properties.
