终端上的可编辑注释,如便利贴

use*_*184 7 command-line gnu-screen

我使用屏幕,这让我可以使用许多终端。但是,由于终端太多,有时我会忘记自己在做什么。是否有任何终端应用程序可以绘制终端的一部分/占用一些空间,并显示可编辑的注释部分?

我不想在屏幕中运行屏幕:-p

小智 8

也许不是您正在寻找的确切内容,但我有一个脚本可以在 bash 提示的开头添加一个字符串。它被调用shellname.sh,看起来像这样:

#!/bin/bash -x

if [[ -z "$ORIG_PS1" ]] ; then
  export ORIG_PS1="$PS1" ;
fi

export PS1="($1) $ORIG_PS1"
Run Code Online (Sandbox Code Playgroud)

然后我可以打电话source ~/testname.sh "Shell Name Here"。请注意,您必须使用source而不是直接运行它,以便它可以影响本地环境。例如:

stokastic@home:~/test# 
stokastic@home:~/test# source ~/shellname.sh "build shell"
(build shell) stokastic@home:~/test# 
(build shell) stokastic@home:~/test# echo "now my shell name is on the left"
now my shell name is on the left
(build shell) stokastic@home:~/test# make
Run Code Online (Sandbox Code Playgroud)