kovidgoyal / kitty

Cross-platform, fast, feature-rich, GPU based terminal
https://sw.kovidgoyal.net/kitty/
GNU General Public License v3.0
24.11k stars 972 forks source link

PS1/Prompt Issues in 0.24.2 #4730

Closed pckilgore closed 2 years ago

pckilgore commented 2 years ago

Describe the bug In 0.24.1 my BASH prompt worked as expected.

In 0.24.2 my BASH prompt no longer works

To Reproduce Steps to reproduce the behavior:

  1. Use kitty with bash --version = 5.1.16(1)-release
  2. Use a custom prompt (mine in below)
My Prompt ``` #! /bin/bash parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/::\1/' } prompt="\$(VALU="\$?")\[$(tput bold)\]\t \[$(tput sgr0)\]\[\033[38;5;45m\]\[$(tput bold)\]\[\033[38;5;15m\][\[$(tput bold)\]\[$(tput sgr0)\]\[\033[38;5;3m\]\w\[\033[38;5;1m\]\$(parse_git_branch)\[$(tput bold)\]\[\033[38;5;15m\]]\[$(tput sgr0)\]\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;15m\]\[$(tput bold)\]\[$(tput bold)\]\n\[\033[38;5;15m\]\$\[$(tput sgr0)\] " export PS1="\n\$(VALU="\$?"; if [ \$VALU == 0 ]; then echo \"(\[$(tput bold)\]\[\033[38;5;10m\]✓\[$(tput sgr0)\])\"; else echo \"(\[$(tput bold)\]\[\033[38;5;9m\]✖\[$(tput sgr0)\] - \$VALU)\"; fi) $prompt" ```
  1. See Prompt on Every line in 0.24.1
  2. Only see Prompt on Shell start in 0.24.2

Happy to help debug further Kovid not sure what you might need. Running across both versions with set -x?

Environment details

kitty 0.24.1 created by Kovid Goyal
Darwin patricks-mbp.lan 20.6.0 Darwin Kernel Version 20.6.0: Wed Jan 12 22:22:42 PST 2022; root:xnu-7195.141.19~2/RELEASE_X86_64 x86_64
ProductName:    macOS ProductVersion:   11.6.4 BuildVersion:    20G417
Frozen: True
Paths:
  kitty: /Applications/kitty.app/Contents/MacOS/kitty
  base dir: /Applications/kitty.app/Contents/Resources/kitty
  extensions dir: /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions
  system shell: /usr/local/bin/bash
Loaded config files:
  /Users/patrick/.config/kitty/kitty.conf

Config options different from defaults:
background_opacity                 0.8
background_tint                    0.5
bold_font                          Fira Code SemiBold
confirm_os_window_close            1
copy_on_select                     clipboard
cursor_shape                       2
disable_ligatures                  1
editor                             nvim
enable_audio_bell                  False
font_family                        Fira Code Retina
font_features:
{'Fira': ('Code', '+zero', '+onum')}
font_size                          13.0
inactive_text_alpha                0.8
macos_option_as_alt                3
macos_quit_when_last_window_closed True
scrollback_lines                   10000
strip_trailing_spaces              smart
tab_bar_edge                       1
tab_bar_style                      powerline
Changed shortcuts:
    shift+ctrl+n new_os_window_with_cwd
    shift+ctrl+enter new_window_with_cwd
Colors:
    active_border_color                #0000ff   
    cursor                             #ddddff   

Additional context Try to reproduce the problem with kitty --config NONE if you cannot then post a minimal kitty.conf that reproduces the problem. If the problem involves interaction with some other terminal program post a minimal config for that program to reproduce the problem as well.

pckilgore commented 2 years ago

Suspecting: https://github.com/kovidgoyal/kitty/commit/b53d756bc2bcec7d9428db0716131b38e7359138

kovidgoyal commented 2 years ago

Works fine for me in master. use the nightly kitty build.