Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combinaten zsh + promptline + urxvt won't work well #34

Open
ljrk0 opened this issue Apr 22, 2015 · 5 comments · May be fixed by #38
Open

Combinaten zsh + promptline + urxvt won't work well #34

ljrk0 opened this issue Apr 22, 2015 · 5 comments · May be fixed by #38

Comments

@ljrk0
Copy link

ljrk0 commented Apr 22, 2015

Any other combination combination works:
zsh + promptline + qterminal
bash + promptline + urxvt
zsh + not promptline + urxvt

The first line suggests urxvt is the problem, the second, zsh and the third that promptline is the problem.

The problem itself / steps to reproduce:

  • set up urxvt with zsh and promptline (obviously)
  • type something
  • result:
    MYPROMPT>WHATITYPED
  • hit Ctrl-C and type something
  • result:
    MYPROMPT> WHATITYPEDNOW

notice the whitespace between the > and what I typed in the latter example?
This wouldn't be a major issue itself but when being in the state of having no whitespace one can get wired behavior for example like this:

  • be in "missing whitespace" mode
  • type cd and the beginning of a folder name but only so far as it is still ambiguos.
  • hit tab to get auto-completion
  • the result will be:
    MYPROMPT>ccd ...

now there's a 'ccd'.
These are only "easily reproducible" examples but it can get really weird when one is using the terminal for a longer time.

@ljrk0
Copy link
Author

ljrk0 commented Apr 23, 2015

Probably related to #26 – but I don't know why it's only in urxvt

@ljrk0
Copy link
Author

ljrk0 commented Apr 23, 2015

Probably this commit should fix it:
mhartington/dotfiles@44f81a3
but removing those two lines (the L37 I do not have but I just removed all oh-my-zsh lines) but it won't work for me.

@bzar
Copy link

bzar commented Jun 26, 2015

I'm seeing this same issue using Konsole and Termite

@elken
Copy link

elken commented Jun 26, 2015

Invoking C-c seems to mitigate this, so the prompt is using some function urxvt doesn't like.

EDIT: Seems it's something in

function __promptline_last_exit_code {
    [[ $last_exit_code -gt 0 ]] || return 1;

   printf "%s" "$last_exit_code"
} 

Commenting out the if statement fixes the indent issue, but the return code is always displayed. Also confirmed this, false fixes the issue too.

EDIT 2: Done some more digging, turns out RPROMPT is the issue.

EDIT 3: I seem to have fixed it. I'm looking into creating a PR, but for now make __promptline_right_prompt similar to below.

function __promptline_right_prompt {
     local slice_prefix slice_empty_prefix slice_joiner slice_suffix

     if [ ! -e $(__promptline_last_exit_code) ]; then
     # section "warn" header
     slice_prefix="${warn_sep_fg}${rsep}${warn_fg}${warn_bg}${space}" slice_suffix="$space${warn_sep_fg}"                                                   
    slice_joiner="${warn_fg}${warn_bg}${alt_rsep}${space}" slice_empty_prefix=""
     # section "warn" slices
       __promptline_wrapper "$(__promptline_last_exit_code)" "$slice_prefix" "$slice_suffix" && { slice_prefix="$slice_joiner"; }
     else
       slice_prefix="${reset}"
      __promptline_wrapper "${reset} "
    fi

Result is various terminals.

@elken elken linked a pull request Jun 26, 2015 that will close this issue
dietrichm pushed a commit to dietrichm/promptline.vim that referenced this issue Jul 2, 2016
Some terminals experienced a weird bug with indentation. Should close edkolev#34.
@jda0
Copy link

jda0 commented Sep 13, 2017

Still an issue in bash under WSL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants