aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Majewsky <majewsky@gmx.net>2017-08-19 19:41:43 +0200
committerStefan Majewsky <majewsky@gmx.net>2017-08-19 19:41:43 +0200
commit39cbf9b61a0a22f0f6310a1dbcbe3268c26d786a (patch)
treee81e37cc57f3f21733f90771b1aab9901e19e943
parenta3aab9b7ca3e8ecfa8093a5801ba0bc611699c86 (diff)
downloadgofu-39cbf9b61a0a22f0f6310a1dbcbe3268c26d786a.tar.gz
prettyprompt: print second line with shell identification and prompt char
-rw-r--r--pkg/prompt/main.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/prompt/main.go b/pkg/prompt/main.go
index f46a7e4..e5096e8 100644
--- a/pkg/prompt/main.go
+++ b/pkg/prompt/main.go
@@ -61,6 +61,17 @@ func Exec() int {
}
os.Stdout.Write([]byte(line + "\n"))
+
+ //print second line: a letter identifying the shell, and the final "$ ")
+ shellIdent := ""
+ switch os.Getenv("PRETTYPROMPT_SHELL") {
+ case "zsh":
+ shellIdent = "Z"
+ case "bash":
+ shellIdent = "B"
+ }
+ os.Stdout.Write([]byte(shellIdent + "$ "))
+
return 0
}