]> git.phdru.name Git - dotfiles.git/commitdiff
Feat(screen): Use `shelltitle` trick in `.screenrc`
authorOleg Broytman <phd@phdru.name>
Fri, 21 Aug 2020 00:37:32 +0000 (03:37 +0300)
committerOleg Broytman <phd@phdru.name>
Fri, 21 Aug 2020 00:37:32 +0000 (03:37 +0300)
This was an experiment that only partially succeed:
In the simplest case `screen` changes the caption
to the name of the current program; but it doesn't see programs
that run deeper like programs started under `mc` or `vim`.

.screenrc
.shellrc
admin/prog/bash_prompt

index 2e3ff3e66b90305d3f55e87df8cb332bc0537ed2..279a1204662c7f8e404802bc9e448b53ad9a309a 100644 (file)
--- a/.screenrc
+++ b/.screenrc
@@ -13,6 +13,11 @@ startup_message off
 deflogin on
 shell -$SHELL
 
+# For this to work PS1 prompt must include empty "<esc>k<esc>\" sequence
+# and ends with "$ ".
+#shelltitle "\$ |$SHELL"
+#bind R screen -t '# |root:' sudo su -
+
 # define a bigger scrollback, default is 100 lines
 defscrollback 1024
 
index 1db7013282a2242b6e94423491304ad2737c217e..a5f78d44225b8b0939f169d140113b024d9ceeff 100644 (file)
--- a/.shellrc
+++ b/.shellrc
@@ -354,9 +354,9 @@ mc() {
                OPS1+="\$(prompt_git)"
             fi
          fi
-         OPS1+=" \\$\$SHLVL "
+         OPS1+=" \$SHLVL\\$ "
       else
-         OPS1="\u@\h:\W \\$"
+         OPS1="\u@\h:\W \$SHLVL\\$ "
       fi
    fi
 
index f3575b397e4d6806f7e96f89d64dc03358dd4257..f37966892fa5eed9dc1e3b8d2b03482b0a4b8827 100644 (file)
@@ -116,6 +116,8 @@ set_prompts() {
          OPS1+="\$(prompt_git)"
       fi
    fi
-   OPS1+=" \\$\$SHLVL "
+   # This is for .screenrc: shelltitle "\$ |$SHELL"
+   #OPS1+="\[\033k\033\\\\\]"
+   OPS1+=" \$SHLVL\\$ "
    export OPS1
 }