From 9a8a7b7d5a87b1ac588c00afe73a167a30c23865 Mon Sep 17 00:00:00 2001 From: Stefan Majewsky Date: Fri, 5 Mar 2021 15:41:22 +0100 Subject: prettyprompt: show hostname and shortened pwd in terminal title --- internal/prompt/main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'internal/prompt/main.go') diff --git a/internal/prompt/main.go b/internal/prompt/main.go index dcef513..be5bb59 100644 --- a/internal/prompt/main.go +++ b/internal/prompt/main.go @@ -31,11 +31,12 @@ import ( //Exec executes the prettyprompt applet and returns an exit code (0 for //success, >0 for error). func Exec(args []string) int { + var tt TerminalTitle fields := []string{ - getLoginField(), + getLoginField(&tt), } cwd := CurrentDirectory() - fields = appendUnlessEmpty(fields, getDirectoryField(cwd)) + fields = appendUnlessEmpty(fields, getDirectoryField(cwd, &tt)) fields = appendUnlessEmpty(fields, getDeletedMessageField(cwd)) fields = appendUnlessEmpty(fields, getRepoStatusField(cwd.Repo)) fields = appendUnlessEmpty(fields, getTerminalField()) @@ -78,6 +79,8 @@ func Exec(args []string) int { } os.Stdout.Write([]byte(shellIdent + "$ ")) + tt.PrintTo(os.Stdout) + return 0 } -- cgit v1.3.1