From 2bd6ca065acda41affeed6d7ae8bf98df3de0ef7 Mon Sep 17 00:00:00 2001 From: Loic Nageleisen Date: Wed, 23 Dec 2020 16:32:15 +0100 Subject: [PATCH] Improve screen experience --- bash/prompt | 4 ++++ home/screenrc | 41 +++++++++++++++++++++++++++++++++-------- zsh/prompt | 4 ++++ 3 files changed, 41 insertions(+), 8 deletions(-) diff --git a/bash/prompt b/bash/prompt index 388f7d1..55c1e75 100644 --- a/bash/prompt +++ b/bash/prompt @@ -59,6 +59,10 @@ prompt_build_simple() { echo -n "${HOSTNAME%%.local} " fi + if [[ -n $STY ]]; then + buffer="${buffer}screen " + fi + # add venv info set_color -p yellow if [[ -n "$VIRTUAL_ENV" ]]; then diff --git a/home/screenrc b/home/screenrc index 1397cba..8ef501b 100644 --- a/home/screenrc +++ b/home/screenrc @@ -1,11 +1,36 @@ +# less noise startup_message off - -hardstatus on -hardstatus alwayslastline -#hardstatus string "%3n %t%? @%u%?%? [%h]%?%=%c" -hardstatus string '%{= kW}%-Lw%{= kY}%50>%n%f* %t%{= kW}%+Lw%< %{= kG}%-=%D %d %M %Y %c:%s%{-}' - -defscrollback 1024 - vbell off +# login shell +shell -${SHELL} + +# tab-like bar +hardstatus on +hardstatus alwayslastline +#hardstatus string '%{= kW}%-Lw%{= kY}%50>%n%f* %t%{= kW}%+Lw%< %{= kG}%-=%c %d-%M-%y%{-}' +hardstatus string '%{= gk}%-Lw%50>%n%f* %t%+Lw%< %-="%H" %c %d-%M-%y%{-}' + +# split title +#caption always "%3n %t%? @%u%?%? [%h]%?%=%c" + +# more room +defscrollback 10000 + +# survive brutality +autodetach on + +# colors +term screen-256color + +# scroll +#termcapinfo xterm* ti@:te@ + +# tmux-like bindings +escape ^bb +bind w windowlist -b +bind x kill +bind ^z suspend + +bind j focus down +bind k focus up diff --git a/zsh/prompt b/zsh/prompt index 22af2be..40347a3 100644 --- a/zsh/prompt +++ b/zsh/prompt @@ -135,6 +135,10 @@ set_prompt() { buffer="${buffer}${HOST} " fi + if [[ -n $STY ]]; then + buffer="${buffer}screen " + fi + if [[ -n "$VIRTUAL_ENV" ]]; then buffer="${buffer}%F{yellow}${VIRTUAL_ENV##*/} " fi