Two-line transient prompt cuts of last line from previous command #4700
-
Code of Conduct
What happened?I am not quite sure this is an actual bug, it might also be related to my config - but I compared it to the documentation and did not spot an (obvious) issue. I attached a video that show the problem: the transient prompt feature seems to not only remove the lines itself occupied, but also the line above this. Screen.Recording.2024-02-19.at.12.21.09.movTheme# yaml-language-server: $schema=https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json
final_space: true
version: 2
blocks:
# Add a blank line for separation
- alignment: left
type: prompt
segments:
- type: text
style: plain
- alignment: left
newline: false
type: prompt
segments:
- type: "path"
background: "#c386f1"
foreground: "#2b2b2b"
leading_diamond: "\ue0b6"
style: "diamond"
trailing_diamond: "\ue0b0"
template: " {{ .Path }} "
- type: git
background: "#57ffc5"
background_templates:
- "{{ if or (.Working.Changed) (.Staging.Changed) }}#ffc157{{ end }}"
- "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#ff5775{{ end }}"
- "{{ if gt .Ahead 0 }}#ff5775{{ end }}"
- "{{ if gt .Behind 0 }}#ff5775{{ end }}"
foreground: '#2b2b2b'
properties:
branch_max_length: 25
fetch_stash_count: true
fetch_status: true
fetch_upstream_icon: true
style: "powerline"
powerline_symbol: "\ue0b0"
template: " {{ .UpstreamIcon }}{{ .Ref }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }} {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} {{ .StashCount }}{{ end }} "
- type: executiontime
background: 'yellow'
foreground: 'black'
# style: "powerline"
style: "diamond"
properties:
style: austin
threshold: 1000
powerline_symbol: "\ue0b0"
template: " {{ .FormattedMs }} "
leading_diamond: " "
trailing_diamond: " "
- alignment: right
type: prompt
newline: false
segments:
- background: '#29315A'
foreground: '#E4F34A'
leading_diamond: ' '
properties:
fetch_version: false
style: diamond
template: >-
{{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}{{ .Venv }} {{
end }}{{ .Full }}{{ end }}
trailing_diamond:
type: python
- type: go
background: '#29315A'
foreground: '#7FD5EA'
leading_diamond: ' '
properties:
fetch_version: true
parse_mod_file: true
style: diamond
template: "\u202D\uFCD1 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}"
trailing_diamond:
- type: kubectl
background: 'blue'
foreground: 'white'
leading_diamond: ' '
properties:
fetch_version: true
parse_mod_file: true
style: diamond
# Do not need the cluster to be shown - but would be: {{ .Cluster }}
template: "\uFD31 {{ if .Namespace }}{{ .Namespace }}{{ else }}default{{ end }}"
trailing_diamond: " "
- type: node
background: '#29315A'
foreground: '#42E66C'
leading_diamond: ' '
properties:
fetch_version: false
style: diamond
template: >-
{{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{
.Full }}
trailing_diamond:
- background: '#29315A'
foreground: '#E64747'
leading_diamond: ' '
properties:
fetch_version: false
style: diamond
template: {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}
trailing_diamond:
type: ruby
- background: '#29315A'
foreground: '#E64747'
leading_diamond: ' '
properties:
fetch_version: false
style: diamond
template: {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}
trailing_diamond:
type: java
- background: '#29315A'
foreground: '#9B6BDF'
leading_diamond: ' '
properties:
fetch_version: false
style: diamond
template: '{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} '
trailing_diamond:
type: julia
- type: php
style: diamond
foreground: '#ffffff'
background: '#4063D8'
leading_diamond: ' '
properties:
fetch_version: false
template: ' {{ .Full }} '
trailing_diamond:
- alignment: left
type: prompt
newline: true
segments:
- type: text
# background: '#29315A'
foreground_templates:
- "{{ if ne .Code 0 }}#e24846{{ else }}#46e27f{{ end }}"
# leading_diamond:
style: diamond
template: '❯'
# trailing_diamond:
transient_prompt:
# type: "text"
foreground: "#bba4db"
template: '{{ now | date "15:04:05" }} ❯ ' What OS are you seeing the problem on?macOS Which shell are you using?zsh 5.9 Log outputCan provide this if required, but need to strip some sensitive data first :/ |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
@FlorianLoch which shell is this? PowerShell has a bug that does this. We set the prompt lines correctly, but on redraw they don't respect this somehow. |
Beta Was this translation helpful? Give feedback.
-
Oh, sorry for omitting this... It's zsh 5.9 running inside iterm2. I will update the template above too. |
Beta Was this translation helpful? Give feedback.
-
@FlorianLoch cool, I'll have a look at how to reproduce that there as well. |
Beta Was this translation helpful? Give feedback.
-
@FlorianLoch I can't reproduce this at all. Something else on your zsh setup/machine is influencing this negatively. |
Beta Was this translation helpful? Give feedback.
I actually found the solution to this - and it was basically in front of my eyes and had nothing to do with
tmux
or the shell...There was a unicode control character in one of the "version indicators", that I thought would be an icon because I couldn't tell from the codepoint and did not initially look it up...: https://unicodeplus.com/U+202D
Why was the issue gone outside of
tmux
? I wasn't in a go project...