From 39cbf9b61a0a22f0f6310a1dbcbe3268c26d786a Mon Sep 17 00:00:00 2001 From: Stefan Majewsky Date: Sat, 19 Aug 2017 19:41:43 +0200 Subject: prettyprompt: print second line with shell identification and prompt char --- pkg/prompt/main.go | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 } -- cgit v1.3.1