diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2021-03-05 15:41:22 +0100 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2021-03-05 15:41:22 +0100 |
| commit | 9a8a7b7d5a87b1ac588c00afe73a167a30c23865 (patch) | |
| tree | f6e75261e3142af91e117c61e1f56c62b0b58d7c /internal/prompt/main.go | |
| parent | 122068efd4a348921b736b4456d4e1c999dbfb79 (diff) | |
| download | gofu-9a8a7b7d5a87b1ac588c00afe73a167a30c23865.tar.gz | |
prettyprompt: show hostname and shortened pwd in terminal title
Diffstat (limited to 'internal/prompt/main.go')
| -rw-r--r-- | internal/prompt/main.go | 7 |
1 files changed, 5 insertions, 2 deletions
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 } |
