diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2017-08-19 19:41:43 +0200 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2017-08-19 19:41:43 +0200 |
| commit | 39cbf9b61a0a22f0f6310a1dbcbe3268c26d786a (patch) | |
| tree | e81e37cc57f3f21733f90771b1aab9901e19e943 /pkg | |
| parent | a3aab9b7ca3e8ecfa8093a5801ba0bc611699c86 (diff) | |
| download | gofu-39cbf9b61a0a22f0f6310a1dbcbe3268c26d786a.tar.gz | |
prettyprompt: print second line with shell identification and prompt char
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/prompt/main.go | 11 |
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 } |
