multiline prompt problem in bash on windows (git-bash, cygwin, msys) #6678
|
whenever i type a command that's longer than the window/terminal width, it overwrites the last line of the prompt. this only happens in bash on windows. powershell and cmd are fine. bug.mp4strangely, using any of the themes listed on this page with multiline prompts doesn't yield this behavior, which means it's a problem on my end, but i just can't figure out what it is. my configuration{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"console_title_template": "{{if not (eq .Shell \"bash\")}} {{.Folder}}{{if .Root}} ❧ admin {{end}} 🌸 {{.Shell}} {{end}}",
"palette": {
"white": "#ffffff",
"black": "#000",
"accent": "#00e7e3",
"accent-light": "#affffe",
"light-pink": "#ffccd9",
"pink": "#ff3783",
"purple": "#8134de",
"blue": "#1289FF",
"go-blue": "#80e6ff",
"light-green": "#16ff7f"
},
"secondary_prompt": {
"background": "transparent",
"foreground": "p:accent",
"template": "-> "
},
"blocks": [
{
"type": "prompt",
"alignment": "left",
"segments": [
{
"template": "{{ if false }}{{ end }}",
"type": "session",
"style": "diamond"
},
{
"properties": {
"cache_duration": "none",
"style": "roundrock"
},
"template": " \uf017 {{ .FormattedMs }} ",
"foreground": "p:black",
"background": "p:light-pink",
"type": "executiontime",
"style": "diamond",
"leading_diamond": "\uE0B6",
"trailing_diamond": "\uE0B0"
},
{
"background": "p:pink",
"foreground": "p:white",
"style": "diamond",
"template": " {{ if .WSL }}WSL at {{ end }}{{.Icon}}",
"type": "os"
},
{
"template": "{{.HostName}} ",
"powerline_symbol": "\ue0b0",
"foreground": "p:white",
"background": "p:pink",
"type": "text",
"style": "powerline"
},
{
"properties": {
"branch_icon": "\ue725 ",
"branch_identical_icon": "\ue279",
"cache_duration": "none",
"fetch_stash_count": true,
"fetch_status": true,
"fetch_upstream_icon": true
},
"template": " {{ .HEAD }} \ue621{{if .BranchStatus }} {{ .BranchStatus }} {{ end }} {{ if .Working.Changed }}\uf044 {{ .Working.Modified }}{{ end }} ",
"foreground": "p:white",
"powerline_symbol": "\ue0b0",
"background": "p:purple",
"type": "git",
"style": "powerline"
},
{
"template": " \ue753 {{ .Full }} ",
"foreground": "p:black",
"powerline_symbol": "\ue0b0",
"background": "p:blue",
"type": "angular",
"style": "powerline"
},
{
"template": " \ue71e {{ .Full }} ",
"powerline_symbol": "\ue0b0",
"foreground": "p:black",
"background": "p:blue",
"type": "npm",
"style": "powerline"
},
{
"type": "go",
"style": "powerline",
"powerline_symbol": "\ue0b0",
"foreground": "p:black",
"background": "p:go-blue",
"template": " \ue627 {{ .Full }} "
},
{
"properties": {
"cache_duration": "none"
},
"template": " \ue235 {{ .Full }} ",
"foreground": "p:black",
"powerline_symbol": "\ue0b0",
"background": "p:light-green",
"type": "python",
"style": "powerline"
},
{
"properties": {
"cache_duration": "none"
},
"template": " \ue718 {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }} ",
"foreground": "p:black",
"powerline_symbol": "\ue0b0",
"background": "p:light-green",
"type": "node",
"style": "powerline"
}
],
"newline": true
},
{
"type": "prompt",
"alignment": "right",
"segments": [
{
"type": "time",
"style": "diamond",
"background": "p:accent-light",
"foreground": "p:black",
"leading_diamond": "\uE0B6",
"trailing_diamond": "\uE0B4",
"properties": {
"time_format": "Mon, 02-01-2006 03:04 PM"
},
"min_width": 80
}
]
},
{
"type": "prompt",
"overflow": "break",
"alignment": "left",
"newline": true,
"segments": [
{
"template": "{{ if false }}{{ end }}",
"type": "session",
"style": "diamond"
},
{
"properties": {
"folder_icon": "\udb83\uddcf",
"folder_separator_icon": " \ueab6 ",
"hide_root_location": true,
"home_icon": "\udb82\uddf0",
"max_depth": 10,
"style": "full"
},
"template": " {{path .Path .Location}} ",
"foreground": "p:black",
"background": "p:accent",
"leading_diamond": "\uE0B6",
"trailing_diamond": "\uE0B4",
"type": "path",
"style": "diamond"
},
{
"template": "\u276F",
"foreground": "p:white",
"type": "text",
"style": "plain"
}
]
}
],
"final_space": true,
"version": 3
} |
Replies: 1 comment 3 replies
|
@GamerGirlandCo something important to note is that bash on Windows (any cygwin derivative) is a terrible experience for a shell as it's not native and comes with quite a lot of quirks. One of those is that certain characters (like some nerd font glyphs) are counted incorrectly. Don't ask why, as this doesn't happen on native bash (unix/macOS). I really advise against using these shells, and move to an actually native alternative like nushell for example. |
@GamerGirlandCo something important to note is that bash on Windows (any cygwin derivative) is a terrible experience for a shell as it's not native and comes with quite a lot of quirks. One of those is that certain characters (like some nerd font glyphs) are counted incorrectly. Don't ask why, as this doesn't happen on native bash (unix/macOS). I really advise against using these shells, and move to an actually native alternative like nushell for example.