From 98e69defac5e93cf8f9f4a20e98404e2383674bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Pankowski?= Date: Mon, 24 Jun 2024 22:49:34 +0200 Subject: [PATCH] bash: remove exec new, improve prompt, block cursor during command --- shell/.bashrc | 7 ++++--- shell/.inputrc | 10 ++++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/shell/.bashrc b/shell/.bashrc index 3859931..911ca4d 100644 --- a/shell/.bashrc +++ b/shell/.bashrc @@ -5,7 +5,8 @@ # If not running interactively, don't do anything [[ $- != *i* ]] && return -which nu >/dev/null && exec nu - alias ls='ls --color=auto' -PS1='[\u@\h \W]\$ ' +PS1='\e[34m\u@\h\e[0m \e[32m\W\e[0m \$ ' + +function before_command() { echo -ne '\e[2 q'; } +trap before_command DEBUG diff --git a/shell/.inputrc b/shell/.inputrc index 95731ea..7b56e28 100644 --- a/shell/.inputrc +++ b/shell/.inputrc @@ -1,5 +1,11 @@ set editing-mode vi set show-mode-in-prompt on -set vi-ins-mode-string \1\e[6 q\2 -set vi-cmd-mode-string \1\e[2 q\2 +set vi-ins-mode-string \1\e[6 q\2\e[31m[+]\e[0m \2 +set vi-cmd-mode-string \1\e[2 q\2\e[32m[:]\e[0m \2 +set keymap vi-command +"k": history-substring-search-backward +"j": history-substring-search-forward + +set keymap vi-insert +"\C-l": clear-screen