瀏覽代碼

Add scripts to set purpose in shell title

Use `purpose <title-prefix>` to set the purpose of your current shell
(only set the FISH_SHELL_PURPOSE env variable).

Add a custom fish_title function.
DricomDragon 5 年之前
父節點
當前提交
43bb07e2b8
共有 2 個文件被更改,包括 6 次插入0 次删除
  1. 3 0
      Install/Templates/fish/functions/fish_title.fish
  2. 3 0
      Install/Templates/fish/functions/purpose.fish

+ 3 - 0
Install/Templates/fish/functions/fish_title.fish

@@ -1,3 +1,6 @@
 function fish_title
+	if set -q FISH_SHELL_PURPOSE
+		echo -n "[$FISH_SHELL_PURPOSE] "
+	end
     echo $argv[1]
 end

+ 3 - 0
Install/Templates/fish/functions/purpose.fish

@@ -0,0 +1,3 @@
+function purpose
+	set --global FISH_SHELL_PURPOSE $argv
+end