diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2021-03-05 16:33:33 +0100 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2021-03-05 16:33:33 +0100 |
| commit | b54666832935e263f93d61fb2db1d98c88e48ea9 (patch) | |
| tree | 2522cb71511d4e51e354d04423b10f076499c94e /internal | |
| parent | 9e587a8cc4add8958753e9e477c0646ec6cb62c7 (diff) | |
| download | gofu-b54666832935e263f93d61fb2db1d98c88e48ea9.tar.gz | |
prettyprompt: fix zsh line length computation
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/prompt/main.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/prompt/main.go b/internal/prompt/main.go index be5bb59..f403f6c 100644 --- a/internal/prompt/main.go +++ b/internal/prompt/main.go @@ -47,6 +47,10 @@ func Exec(args []string) int { fields = appendUnlessEmpty(fields, getExitCodeField(args[0])) } + //print terminal title first, otherwise it confuses zsh's line length + //computation and makes it misplace UI elements + tt.PrintTo(os.Stdout) + line := strings.Join(fields, " ") lineWidth := getPrintableLength(line) @@ -79,8 +83,6 @@ func Exec(args []string) int { } os.Stdout.Write([]byte(shellIdent + "$ ")) - tt.PrintTo(os.Stdout) - return 0 } |
