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

Terminal output newline when pasting or resizing terminal #151

Closed
goranmoomin opened this issue Mar 18, 2019 · 17 comments
Closed

Terminal output newline when pasting or resizing terminal #151

goranmoomin opened this issue Mar 18, 2019 · 17 comments
Labels
🐛 bug something that doesn't works as expected 🙏 help wanted needs PR or help on decision

Comments

@goranmoomin
Copy link

When I open a terminal emulator window and paste anything in it (agnostic to the terminal emulator, e.g. Terminal.app, iTerm2, Alacritty) or resize it, the path indicator is redrawn in the second line(not on the first), and the prompt is redrawn in the third line(not on the second).

Here's a gif(23MB) -> It gets expired after 7 days, so please ping me if it's expired :-)

@edouard-lopez edouard-lopez added the 🐛 bug something that doesn't works as expected label Mar 18, 2019
@edouard-lopez
Copy link
Member

Hi @pcr910303,

Could you give us the value for:

echo $pure_version
fish --version

Also could you try with hyper terminal?

Ping That's might be a Mac-related issue @rafaelrinaldi @schrodincat

@goranmoomin
Copy link
Author

goranmoomin commented Mar 18, 2019

~echo $pure_version 
2.1.1

~
❯ fish --version
fish, version 3.0.2-608-g05b9c078

This problem persisted from at least fish 2.7. (I'm currently using a HEAD version for CJK language issues.)

@goranmoomin
Copy link
Author

The problem persists with the Hyper terminal. :-(
무제

@andreiborisov
Copy link
Collaborator

@edouard-lopez it's definitely happening for me too, but I'm not sure this is Mac-related issue

@edouard-lopez
Copy link
Member

edouard-lopez commented Mar 19, 2019

It's cross-platform tmux was interfering in my test.

I reproduce the issue for copy/paste and resize only for the first prompt.

Here is some debug information that might help.

fish -d 3
~ master*
❯ <3> fish: Created job 2 from command 'set -g __fish_last_bind_mode $fish_bind_mode' with pgrp -2
<3> fish: Created job 2 from command 'source /usr/share/fish/functions/__fish_commandline_is_singlequoted.fish' with pgrp -2
<3> fish: Created job 2 from command 'set -l state normal' with pgrp -2
<3> fish: Created job 4 from command 'commandline -ct | string split ""' with pgrp 5414
<3> fish: Created job 4 from command 'contains -- $state single single-escaped' with pgrp -2
<3> fish: Created job 2 from command 'return 1' with pgrp -2
<3> fish: Created job 3 from command '__fish_commandline_is_singlequoted' with pgrp -2
<3> fish: Created job 1 from command '__fish_start_bracketed_paste' with pgrp -2
echo $pure_version <3> fish: Created job 2 from command 'set fish_bind_mode $__fish_last_bind_mode' with pgrp -2
<3> fish: Created job 3 from command 'set -e __fish_paste_quoted' with pgrp -2
<3> fish: Created job 2 from command 'commandline -f force-repaint' with pgrp -2
<3> fish: Created job 1 from command '__fish_stop_bracketed_paste' with pgrp -2
<3> fish: Created job 2 from command 'set --local exit_code $status' with pgrp -2
<3> fish: Created job 4 from command 'set --local new_line' with pgrp -2
<3> fish: Created job 5 from command 'test $_pure_fresh_session = false' with pgrp -2
<3> fish: Created job 4 from command 'set new_line "\n"' with pgrp -2
<3> fish: Created job 4 from command 'set --local new_line "$new_line\r\033[K"' with pgrp -2
<3> fish: Created job 5 from command 'echo $new_line' with pgrp -2
<3> fish: Created job 2 from command '_pure_prompt_beginning' with pgrp -2
<3> fish: Created job 3 from command 'echo -e -n (_pure_prompt_beginning)' with pgrp -2
<3> fish: Created job 5 from command 'set -q argv[1]' with pgrp -2
<3> fish: Created job 6 from command 'set -l options 'h/help' 'a/all' 'f/no-functions' 't/type' 'p/path' 'P/force-path' 'q/quiet'' with pgrp -2
<3> fish: Created job 5 from command 'argparse -n type -x t,p,P $options -- $argv' with pgrp -2
<3> fish: Created job 6 from command 'set -q _flag_help' with pgrp -2
<3> fish: Created job 5 from command 'set -l res 1' with pgrp -2
<3> fish: Created job 6 from command 'set -l mode normal' with pgrp -2
<3> fish: Created job 5 from command 'set -l multi no' with pgrp -2
<3> fish: Created job 6 from command 'set -l selection all' with pgrp -2
<3> fish: Created job 5 from command 'set -q _flag_quiet' with pgrp -2
<3> fish: Created job 6 from command 'set mode quiet' with pgrp -2
<3> fish: Created job 6 from command 'set -q _flag_all' with pgrp -2
<3> fish: Created job 5 from command 'set -q _flag_no_functions' with pgrp -2
<3> fish: Created job 6 from command 'set selection files' with pgrp -2
<3> fish: Created job 5 from command 'set -l found 0' with pgrp -2
<3> fish: Created job 7 from command 'test $selection != files' with pgrp -2
<3> fish: Created job 5 from command 'set -l paths' with pgrp -2
<3> fish: Created job 7 from command 'test $multi != yes' with pgrp -2
<3> fish: Created job 8 from command 'command -s -- $i' with pgrp -2
<3> fish: Created job 5 from command 'set paths (command -s -- $i)' with pgrp -2
<3> fish: Created job 5 from command 'set res 0' with pgrp -2
<3> fish: Created job 8 from command 'set found 1' with pgrp -2
<3> fish: Created job 5 from command 'test $multi != yes' with pgrp -2
<3> fish: Created job 8 from command 'continue' with pgrp -2
<3> fish: Created job 5 from command 'test $found = 0' with pgrp -2
<3> fish: Created job 5 from command 'return $res' with pgrp -2
<3> fish: Created job 4 from command 'not type -fq git' with pgrp -2
<3> fish: Created job 7 from command 'test "$SSH_CONNECTION" != ""' with pgrp -2
<3> fish: Created job 6 from command '_pure_prompt_ssh' with pgrp -2
<3> fish: Created job 8 from command 'command git rev-parse --is-inside-work-tree 2>/dev/null' with pgrp 5136
<3> fish: Created job 7 from command 'set --local is_git_repository (command git rev-parse --is-inside-work-tree 2>/dev/null)' with pgrp -2
<3> fish: Created job 8 from command 'test -n "$is_git_repository"' with pgrp -2
<3> fish: Created job 12 from command 'command git symbolic-ref --short HEAD 2>/dev/null' with pgrp 5136
<3> fish: Created job 11 from command '_pure_parse_git_branch' with pgrp -2
<3> fish: Created job 10 from command 'set --local git_branch (_pure_parse_git_branch)' with pgrp -2
<3> fish: Created job 11 from command 'set --local git_branch_color "$pure_color_git_branch"' with pgrp -2
<3> fish: Created job 10 from command 'echo "$git_branch_color$git_branch"' with pgrp -2
<3> fish: Created job 9 from command '_pure_prompt_git_branch' with pgrp -2
<3> fish: Created job 10 from command 'set --local git_dirty_symbol' with pgrp -2
<3> fish: Created job 11 from command 'set --local git_dirty_color' with pgrp -2
<3> fish: Created job 11 from command 'command git status --porcelain --ignore-submodules 2>/dev/null' with pgrp 5136
<3> fish: Created job 10 from command 'set --local is_git_dirty (command git status --porcelain --ignore-submodules 2>/dev/null)' with pgrp -2
<3> fish: Created job 11 from command 'test -n "$is_git_dirty"' with pgrp -2
<3> fish: Created job 10 from command 'set git_dirty_symbol "$pure_symbol_git_dirty"' with pgrp -2
<3> fish: Created job 12 from command 'set git_dirty_color "$pure_color_git_dirty"' with pgrp -2
<3> fish: Created job 10 from command 'echo "$git_dirty_color$git_dirty_symbol"' with pgrp -2
<3> fish: Created job 9 from command '_pure_prompt_git_dirty' with pgrp -2
<3> fish: Created job 7 from command 'set --local git_prompt (_pure_prompt_git_branch)(_pure_prompt_git_dirty)' with pgrp -2
<3> fish: Created job 10 from command 'set --local git_unpushed_commits' with pgrp -2
<3> fish: Created job 11 from command 'set --local git_unpulled_commits' with pgrp -2
<3> fish: Created job 11 from command 'command git rev-parse --abbrev-ref '@{upstream}' 2>/dev/null' with pgrp 5136
<3> fish: Created job 10 from command 'set --local has_upstream (command git rev-parse --abbrev-ref '@{upstream}' 2>/dev/null)' with pgrp -2
<3> fish: Created job 11 from command 'test -n "$has_upstream"' with pgrp -2
<3> fish: Created job 10 from command 'echo "$git_unpushed_commits$git_unpulled_commits"' with pgrp -2
<3> fish: Created job 7 from command '_pure_prompt_git_pending_commits' with pgrp -2
<3> fish: Created job 9 from command 'set --local git_pending_commits (_pure_prompt_git_pending_commits)' with pgrp -2
<3> fish: Created job 10 from command 'set --local empty ''' with pgrp -2
<3> fish: Created job 10 from command 'string replace --all --regex '\e\[[^m]*m' $empty $prompt' with pgrp -2
<3> fish: Created job 11 from command 'set --local raw_prompt (string replace --all --regex '\e\[[^m]*m' $empty $prompt)' with pgrp -2
<3> fish: Created job 10 from command 'string length $raw_prompt' with pgrp -2
<3> fish: Created job 9 from command '_pure_string_width $git_pending_commits' with pgrp -2
<3> fish: Created job 7 from command 'test (_pure_string_width $git_pending_commits) -ne 0' with pgrp -2
<3> fish: Created job 9 from command 'echo $git_prompt' with pgrp -2
<3> fish: Created job 6 from command '_pure_prompt_git' with pgrp -2
<3> fish: Created job 7 from command 'set --local command_duration' with pgrp -2
<3> fish: Created job 8 from command 'test -n "$CMD_DURATION"' with pgrp -2
<3> fish: Created job 10 from command 'test $milliseconds -lt 0' with pgrp -2
<3> fish: Created job 10 from command 'math -s0 "$milliseconds / 1000 % 60"' with pgrp -2
<3> fish: Created job 11 from command 'set --local seconds (math -s0 "$milliseconds / 1000 % 60")' with pgrp -2
<3> fish: Created job 11 from command 'math -s0 "$milliseconds / 60000 % 60"' with pgrp -2
<3> fish: Created job 10 from command 'set --local minutes (math -s0 "$milliseconds / 60000 % 60")' with pgrp -2
<3> fish: Created job 10 from command 'math -s0 "$milliseconds / 3600000 % 24"' with pgrp -2
<3> fish: Created job 11 from command 'set --local hours (math -s0 "$milliseconds / 3600000 % 24")' with pgrp -2
<3> fish: Created job 11 from command 'math -s0 "$milliseconds / 86400000"' with pgrp -2
<3> fish: Created job 10 from command 'set --local days (math -s0 "$milliseconds / 86400000")' with pgrp -2
<3> fish: Created job 11 from command 'set --local time' with pgrp -2
<3> fish: Created job 10 from command 'test $days -gt 0' with pgrp -2
<3> fish: Created job 11 from command 'test $hours -gt 0' with pgrp -2
<3> fish: Created job 10 from command 'test $minutes -gt 0' with pgrp -2
<3> fish: Created job 11 from command 'test $seconds -gt $threshold' with pgrp -2
<3> fish: Created job 11 from command 'string join ' ' $time' with pgrp -2
<3> fish: Created job 10 from command 'echo -e (string join ' ' $time)' with pgrp -2
<3> fish: Created job 9 from command '_pure_format_time $CMD_DURATION $pure_threshold_command_duration' with pgrp -2
<3> fish: Created job 7 from command 'set command_duration (_pure_format_time $CMD_DURATION $pure_threshold_command_duration)' with pgrp -2
<3> fish: Created job 7 from command 'set --local command_duration_color "$pure_color_command_duration"' with pgrp -2
<3> fish: Created job 8 from command 'echo "$command_duration_color$command_duration"' with pgrp -2
<3> fish: Created job 6 from command '_pure_prompt_command_duration' with pgrp -2
<3> fish: Created job 6 from command 'set --local prompt' with pgrp -2
<3> fish: Created job 9 from command 'set --local empty ''' with pgrp -2
<3> fish: Created job 9 from command 'string replace --all --regex '\e\[[^m]*m' $empty $prompt' with pgrp -2
<3> fish: Created job 10 from command 'set --local raw_prompt (string replace --all --regex '\e\[[^m]*m' $empty $prompt)' with pgrp -2
<3> fish: Created job 9 from command 'string length $raw_prompt' with pgrp -2
<3> fish: Created job 8 from command '_pure_string_width $prompt_part' with pgrp -2
<3> fish: Created job 7 from command 'test (_pure_string_width $prompt_part) -gt 0' with pgrp -2
<3> fish: Created job 8 from command 'set prompt "$prompt $prompt_part"' with pgrp -2
<3> fish: Created job 9 from command 'set --local empty ''' with pgrp -2
<3> fish: Created job 9 from command 'string replace --all --regex '\e\[[^m]*m' $empty $prompt' with pgrp -2
<3> fish: Created job 10 from command 'set --local raw_prompt (string replace --all --regex '\e\[[^m]*m' $empty $prompt)' with pgrp -2
<3> fish: Created job 9 from command 'string length $raw_prompt' with pgrp -2
<3> fish: Created job 7 from command '_pure_string_width $prompt_part' with pgrp -2
<3> fish: Created job 8 from command 'test (_pure_string_width $prompt_part) -gt 0' with pgrp -2
<3> fish: Created job 6 from command 'string trim -l $prompt' with pgrp -2
<3> fish: Created job 7 from command 'echo (string trim -l $prompt)' with pgrp -2
<3> fish: Created job 4 from command '_pure_print_prompt \
                            (_pure_prompt_ssh) \
                            (_pure_prompt_git) \
                            (_pure_prompt_command_duration)' with pgrp -2
<3> fish: Created job 5 from command 'set --local prompt (_pure_print_prompt \
                            (_pure_prompt_ssh) \
                            (_pure_prompt_git) \
                            (_pure_prompt_command_duration)
                        )' with pgrp -2
<3> fish: Created job 6 from command 'set --local empty ''' with pgrp -2
<3> fish: Created job 6 from command 'string replace --all --regex '\e\[[^m]*m' $empty $prompt' with pgrp -2
<3> fish: Created job 7 from command 'set --local raw_prompt (string replace --all --regex '\e\[[^m]*m' $empty $prompt)' with pgrp -2
<3> fish: Created job 6 from command 'string length $raw_prompt' with pgrp -2
<3> fish: Created job 5 from command '_pure_string_width $prompt' with pgrp -2
<3> fish: Created job 4 from command 'set --local prompt_width (_pure_string_width $prompt)' with pgrp -2
<3> fish: Created job 6 from command 'test -z "$current_prompt_width"' with pgrp -2
<3> fish: Created job 8 from command 'math $COLUMNS - $current_prompt_width - 1' with pgrp -2
<3> fish: Created job 9 from command 'string replace $HOME '~' $PWD' with pgrp -2
<3> fish: Created job 8 from command 'set --local folder (string replace $HOME '~' $PWD)' with pgrp -2
<3> fish: Created job 9 from command 'test -n "$max_path_length"' with pgrp -2
<3> fish: Created job 10 from command 'string length $folder' with pgrp -2
<3> fish: Created job 8 from command 'test (string length $folder) -gt $max_path_length' with pgrp -2
<3> fish: Created job 8 from command 'echo $folder' with pgrp -2
<3> fish: Created job 6 from command '_pure_parse_directory (math $COLUMNS - $current_prompt_width - 1)' with pgrp -2
<3> fish: Created job 7 from command 'set --local current_folder (_pure_parse_directory (math $COLUMNS - $current_prompt_width - 1))' with pgrp -2
<3> fish: Created job 6 from command 'set --local current_folder_color "$pure_color_current_directory"' with pgrp -2
<3> fish: Created job 7 from command 'echo "$current_folder_color$current_folder"' with pgrp -2
<3> fish: Created job 4 from command '_pure_prompt_current_folder $prompt_width' with pgrp -2
<3> fish: Created job 5 from command 'set --local current_folder (_pure_prompt_current_folder $prompt_width)' with pgrp -2
<3> fish: Created job 4 from command 'set --local prompt_components' with pgrp -2
<3> fish: Created job 5 from command 'test $pure_begin_prompt_with_current_directory = true' with pgrp -2
<3> fish: Created job 7 from command 'test -z "$current_prompt_width"' with pgrp -2
<3> fish: Created job 9 from command 'math $COLUMNS - $current_prompt_width - 1' with pgrp -2
<3> fish: Created job 10 from command 'string replace $HOME '~' $PWD' with pgrp -2
<3> fish: Created job 9 from command 'set --local folder (string replace $HOME '~' $PWD)' with pgrp -2
<3> fish: Created job 10 from command 'test -n "$max_path_length"' with pgrp -2
<3> fish: Created job 11 from command 'string length $folder' with pgrp -2
<3> fish: Created job 9 from command 'test (string length $folder) -gt $max_path_length' with pgrp -2
<3> fish: Created job 9 from command 'echo $folder' with pgrp -2
<3> fish: Created job 7 from command '_pure_parse_directory (math $COLUMNS - $current_prompt_width - 1)' with pgrp -2
<3> fish: Created job 8 from command 'set --local current_folder (_pure_parse_directory (math $COLUMNS - $current_prompt_width - 1))' with pgrp -2
<3> fish: Created job 7 from command 'set --local current_folder_color "$pure_color_current_directory"' with pgrp -2
<3> fish: Created job 8 from command 'echo "$current_folder_color$current_folder"' with pgrp -2
<3> fish: Created job 6 from command '_pure_prompt_current_folder $prompt_width' with pgrp -2
<3> fish: Created job 8 from command 'command git rev-parse --is-inside-work-tree 2>/dev/null' with pgrp 5136
<3> fish: Created job 7 from command 'set --local is_git_repository (command git rev-parse --is-inside-work-tree 2>/dev/null)' with pgrp -2
<3> fish: Created job 8 from command 'test -n "$is_git_repository"' with pgrp -2
<3> fish: Created job 12 from command 'command git symbolic-ref --short HEAD 2>/dev/null' with pgrp 5136
<3> fish: Created job 11 from command '_pure_parse_git_branch' with pgrp -2
<3> fish: Created job 10 from command 'set --local git_branch (_pure_parse_git_branch)' with pgrp -2
<3> fish: Created job 11 from command 'set --local git_branch_color "$pure_color_git_branch"' with pgrp -2
<3> fish: Created job 10 from command 'echo "$git_branch_color$git_branch"' with pgrp -2
<3> fish: Created job 9 from command '_pure_prompt_git_branch' with pgrp -2
<3> fish: Created job 10 from command 'set --local git_dirty_symbol' with pgrp -2
<3> fish: Created job 11 from command 'set --local git_dirty_color' with pgrp -2
<3> fish: Created job 11 from command 'command git status --porcelain --ignore-submodules 2>/dev/null' with pgrp 5136
<3> fish: Created job 10 from command 'set --local is_git_dirty (command git status --porcelain --ignore-submodules 2>/dev/null)' with pgrp -2
<3> fish: Created job 11 from command 'test -n "$is_git_dirty"' with pgrp -2
<3> fish: Created job 10 from command 'set git_dirty_symbol "$pure_symbol_git_dirty"' with pgrp -2
<3> fish: Created job 12 from command 'set git_dirty_color "$pure_color_git_dirty"' with pgrp -2
<3> fish: Created job 10 from command 'echo "$git_dirty_color$git_dirty_symbol"' with pgrp -2
<3> fish: Created job 9 from command '_pure_prompt_git_dirty' with pgrp -2
<3> fish: Created job 7 from command 'set --local git_prompt (_pure_prompt_git_branch)(_pure_prompt_git_dirty)' with pgrp -2
<3> fish: Created job 10 from command 'set --local git_unpushed_commits' with pgrp -2
<3> fish: Created job 11 from command 'set --local git_unpulled_commits' with pgrp -2
<3> fish: Created job 11 from command 'command git rev-parse --abbrev-ref '@{upstream}' 2>/dev/null' with pgrp 5136
<3> fish: Created job 10 from command 'set --local has_upstream (command git rev-parse --abbrev-ref '@{upstream}' 2>/dev/null)' with pgrp -2
<3> fish: Created job 11 from command 'test -n "$has_upstream"' with pgrp -2
<3> fish: Created job 10 from command 'echo "$git_unpushed_commits$git_unpulled_commits"' with pgrp -2
<3> fish: Created job 7 from command '_pure_prompt_git_pending_commits' with pgrp -2
<3> fish: Created job 9 from command 'set --local git_pending_commits (_pure_prompt_git_pending_commits)' with pgrp -2
<3> fish: Created job 10 from command 'set --local empty ''' with pgrp -2
<3> fish: Created job 10 from command 'string replace --all --regex '\e\[[^m]*m' $empty $prompt' with pgrp -2
<3> fish: Created job 11 from command 'set --local raw_prompt (string replace --all --regex '\e\[[^m]*m' $empty $prompt)' with pgrp -2
<3> fish: Created job 10 from command 'string length $raw_prompt' with pgrp -2
<3> fish: Created job 9 from command '_pure_string_width $git_pending_commits' with pgrp -2
<3> fish: Created job 7 from command 'test (_pure_string_width $git_pending_commits) -ne 0' with pgrp -2
<3> fish: Created job 9 from command 'echo $git_prompt' with pgrp -2
<3> fish: Created job 6 from command '_pure_prompt_git' with pgrp -2
<3> fish: Created job 7 from command 'test "$SSH_CONNECTION" != ""' with pgrp -2
<3> fish: Created job 6 from command '_pure_prompt_ssh' with pgrp -2
<3> fish: Created job 7 from command 'set --local command_duration' with pgrp -2
<3> fish: Created job 8 from command 'test -n "$CMD_DURATION"' with pgrp -2
<3> fish: Created job 10 from command 'test $milliseconds -lt 0' with pgrp -2
<3> fish: Created job 10 from command 'math -s0 "$milliseconds / 1000 % 60"' with pgrp -2
<3> fish: Created job 11 from command 'set --local seconds (math -s0 "$milliseconds / 1000 % 60")' with pgrp -2
<3> fish: Created job 11 from command 'math -s0 "$milliseconds / 60000 % 60"' with pgrp -2
<3> fish: Created job 10 from command 'set --local minutes (math -s0 "$milliseconds / 60000 % 60")' with pgrp -2
<3> fish: Created job 10 from command 'math -s0 "$milliseconds / 3600000 % 24"' with pgrp -2
<3> fish: Created job 11 from command 'set --local hours (math -s0 "$milliseconds / 3600000 % 24")' with pgrp -2
<3> fish: Created job 11 from command 'math -s0 "$milliseconds / 86400000"' with pgrp -2
<3> fish: Created job 10 from command 'set --local days (math -s0 "$milliseconds / 86400000")' with pgrp -2
<3> fish: Created job 11 from command 'set --local time' with pgrp -2
<3> fish: Created job 10 from command 'test $days -gt 0' with pgrp -2
<3> fish: Created job 11 from command 'test $hours -gt 0' with pgrp -2
<3> fish: Created job 10 from command 'test $minutes -gt 0' with pgrp -2
<3> fish: Created job 11 from command 'test $seconds -gt $threshold' with pgrp -2
<3> fish: Created job 11 from command 'string join ' ' $time' with pgrp -2
<3> fish: Created job 10 from command 'echo -e (string join ' ' $time)' with pgrp -2
<3> fish: Created job 9 from command '_pure_format_time $CMD_DURATION $pure_threshold_command_duration' with pgrp -2
<3> fish: Created job 7 from command 'set command_duration (_pure_format_time $CMD_DURATION $pure_threshold_command_duration)' with pgrp -2
<3> fish: Created job 7 from command 'set --local command_duration_color "$pure_color_command_duration"' with pgrp -2
<3> fish: Created job 8 from command 'echo "$command_duration_color$command_duration"' with pgrp -2
<3> fish: Created job 6 from command '_pure_prompt_command_duration' with pgrp -2
<3> fish: Created job 4 from command 'set prompt_components \
                (_pure_prompt_current_folder $prompt_width) \
                (_pure_prompt_git) \
                (_pure_prompt_ssh) \
                (_pure_prompt_command_duration)' with pgrp -2
<3> fish: Created job 6 from command 'set --local prompt' with pgrp -2
<3> fish: Created job 9 from command 'set --local empty ''' with pgrp -2
<3> fish: Created job 9 from command 'string replace --all --regex '\e\[[^m]*m' $empty $prompt' with pgrp -2
<3> fish: Created job 10 from command 'set --local raw_prompt (string replace --all --regex '\e\[[^m]*m' $empty $prompt)' with pgrp -2
<3> fish: Created job 9 from command 'string length $raw_prompt' with pgrp -2
<3> fish: Created job 8 from command '_pure_string_width $prompt_part' with pgrp -2
<3> fish: Created job 7 from command 'test (_pure_string_width $prompt_part) -gt 0' with pgrp -2
<3> fish: Created job 8 from command 'set prompt "$prompt $prompt_part"' with pgrp -2
<3> fish: Created job 9 from command 'set --local empty ''' with pgrp -2
<3> fish: Created job 9 from command 'string replace --all --regex '\e\[[^m]*m' $empty $prompt' with pgrp -2
<3> fish: Created job 10 from command 'set --local raw_prompt (string replace --all --regex '\e\[[^m]*m' $empty $prompt)' with pgrp -2
<3> fish: Created job 9 from command 'string length $raw_prompt' with pgrp -2
<3> fish: Created job 7 from command '_pure_string_width $prompt_part' with pgrp -2
<3> fish: Created job 8 from command 'test (_pure_string_width $prompt_part) -gt 0' with pgrp -2
<3> fish: Created job 7 from command 'set prompt "$prompt $prompt_part"' with pgrp -2
<3> fish: Created job 9 from command 'set --local empty ''' with pgrp -2
<3> fish: Created job 9 from command 'string replace --all --regex '\e\[[^m]*m' $empty $prompt' with pgrp -2
<3> fish: Created job 10 from command 'set --local raw_prompt (string replace --all --regex '\e\[[^m]*m' $empty $prompt)' with pgrp -2
<3> fish: Created job 9 from command 'string length $raw_prompt' with pgrp -2
<3> fish: Created job 8 from command '_pure_string_width $prompt_part' with pgrp -2
<3> fish: Created job 7 from command 'test (_pure_string_width $prompt_part) -gt 0' with pgrp -2
<3> fish: Created job 6 from command 'string trim -l $prompt' with pgrp -2
<3> fish: Created job 7 from command 'echo (string trim -l $prompt)' with pgrp -2
<3> fish: Created job 5 from command '_pure_print_prompt $prompt_components' with pgrp -2
<3> fish: Created job 4 from command 'echo (_pure_print_prompt $prompt_components)' with pgrp -2
<3> fish: Created job 3 from command '_pure_prompt_first_line' with pgrp -2
<3> fish: Created job 2 from command 'echo -e (_pure_prompt_first_line)' with pgrp -2
<3> fish: Created job 6 from command 'test -n "$VIRTUAL_ENV"' with pgrp -2
<3> fish: Created job 5 from command '_pure_prompt_virtualenv' with pgrp -2
<3> fish: Created job 4 from command 'set --local virtualenv (_pure_prompt_virtualenv)' with pgrp -2
<3> fish: Created job 6 from command 'test ! $pure_reverse_prompt_symbol_in_vimode' with pgrp -2
<3> fish: Created job 4 from command '_pure_prompt_vimode' with pgrp -2
<3> fish: Created job 5 from command 'set --local vimode_indicator (_pure_prompt_vimode)' with pgrp -2
<3> fish: Created job 8 from command 'set --local prompt_symbol $pure_symbol_prompt' with pgrp -2
<3> fish: Created job 8 from command 'string match -r "fish_(vi|hybrid)_key_bindings" $fish_key_bindings' with pgrp -2
<3> fish: Created job 9 from command 'set --local is_vi_mode (string match -r "fish_(vi|hybrid)_key_bindings" $fish_key_bindings)' with pgrp -2
<3> fish: Created job 8 from command 'test -n "$is_vi_mode" \
            -a "$pure_reverse_prompt_symbol_in_vimode" = true \
            -a "$fish_bind_mode" != "insert"' with pgrp -2
<3> fish: Created job 9 from command 'echo "$prompt_symbol"' with pgrp -2
<3> fish: Created job 7 from command '_pure_get_prompt_symbol' with pgrp -2
<3> fish: Created job 6 from command 'set --local prompt_symbol (_pure_get_prompt_symbol)' with pgrp -2
<3> fish: Created job 7 from command 'set --local command_succeed 0' with pgrp -2
<3> fish: Created job 6 from command 'set --local color_symbol $pure_color_prompt_on_success' with pgrp -2
<3> fish: Created job 7 from command 'test $exit_code -ne $command_succeed' with pgrp -2
<3> fish: Created job 6 from command 'echo "$color_symbol$prompt_symbol"' with pgrp -2
<3> fish: Created job 5 from command '_pure_prompt_symbol $exit_code' with pgrp -2
<3> fish: Created job 4 from command 'set --local pure_symbol (_pure_prompt_symbol $exit_code)' with pgrp -2
<3> fish: Created job 6 from command 'set --local prompt' with pgrp -2
<3> fish: Created job 9 from command 'set --local empty ''' with pgrp -2
<3> fish: Created job 9 from command 'string replace --all --regex '\e\[[^m]*m' $empty $prompt' with pgrp -2
<3> fish: Created job 10 from command 'set --local raw_prompt (string replace --all --regex '\e\[[^m]*m' $empty $prompt)' with pgrp -2
<3> fish: Created job 9 from command 'string length $raw_prompt' with pgrp -2
<3> fish: Created job 8 from command '_pure_string_width $prompt_part' with pgrp -2
<3> fish: Created job 7 from command 'test (_pure_string_width $prompt_part) -gt 0' with pgrp -2
<3> fish: Created job 8 from command 'set prompt "$prompt $prompt_part"' with pgrp -2
<3> fish: Created job 6 from command 'string trim -l $prompt' with pgrp -2
<3> fish: Created job 7 from command 'echo (string trim -l $prompt)' with pgrp -2
<3> fish: Created job 4 from command '_pure_print_prompt $virtualenv $vimode_indicator $pure_symbol' with pgrp -2
<3> fish: Created job 5 from command 'echo (_pure_print_prompt $virtualenv $vimode_indicator $pure_symbol)' with pgrp -2
<3> fish: Created job 2 from command '_pure_prompt $exit_code' with pgrp -2
<3> fish: Created job 3 from command 'echo -e -n (_pure_prompt $exit_code)' with pgrp -2
<3> fish: Created job 4 from command 'echo "$pure_color_normal "' with pgrp -2
<3> fish: Created job 3 from command '_pure_prompt_ending' with pgrp -2
<3> fish: Created job 2 from command 'echo -e (_pure_prompt_ending)' with pgrp -2
<3> fish: Created job 3 from command 'set _pure_fresh_session false' with pgrp -2
<3> fish: Created job 1 from command 'fish_prompt' with pgrp -2
<3> fish: Created job 2 from command 'printf "%s%s%s" $pure_color_right_prompt "$pure_right_prompt" $pure_color_normal' with pgrp -2
<3> fish: Created job 1 from command 'fish_right_prompt' with pgrp -2
<3> fish: Created job 3 from command 'string replace -r '^.*/' '' -- $PWD' with pgrp -2
<3> fish: Created job 2 from command 'set --local basename (string replace -r '^.*/' '' -- $PWD)' with pgrp -2
<3> fish: Created job 5 from command 'string replace $HOME '~' $PWD' with pgrp -2
<3> fish: Created job 4 from command 'set --local folder (string replace $HOME '~' $PWD)' with pgrp -2
<3> fish: Created job 5 from command 'test -n "$max_path_length"' with pgrp -2
<3> fish: Created job 4 from command 'echo $folder' with pgrp -2
<3> fish: Created job 2 from command '_pure_parse_directory' with pgrp -2
<3> fish: Created job 3 from command 'set --local current_folder (_pure_parse_directory)' with pgrp -2
<3> fish: Created job 3 from command 'status current-command 2>/dev/null' with pgrp -2
<3> fish: Created job 2 from command 'set --local current_command (status current-command 2>/dev/null; or echo $_)' with pgrp -2
<3> fish: Created job 3 from command 'set --local prompt "$basename: $last_command $pure_symbol_title_bar_separator $current_command"' with pgrp -2
<3> fish: Created job 2 from command 'test -z "$last_command"' with pgrp -2
<3> fish: Created job 3 from command 'set prompt "$current_folder $pure_symbol_title_bar_separator $current_command"' with pgrp -2
<3> fish: Created job 3 from command 'echo $prompt' with pgrp -2
<3> fish: Created job 1 from command 'fish_title' with pgrp -2
~ master*
❯ echo $pure_version <3> fish: Created job 2 from command 'complete -c echo -s n -d "Do not output a newline"' with pgrp -2
<3> fish: Created job 3 from command 'complete -c echo -s s -d "Do not separate arguments with spaces"' with pgrp -2
<3> fish: Created job 2 from command 'complete -c echo -s E -d "Disable backslash escapes"' with pgrp -2
<3> fish: Created job 3 from command 'complete -c echo -s e -d "Enable backslash escapes"' with pgrp -2
<3> fish: Created job 2 from command 'complete -c echo -s h -l help -d "Display help and exit"' with pgrp -2
<3> fish: Created job 1 from command 'source /usr/share/fish/completions/echo.fish' with pgrp -2

@edouard-lopez
Copy link
Member

edouard-lopez commented Mar 19, 2019

@faho is this related to binding mode? (see fish-shell/fish-shell#3481)

@andreiborisov
Copy link
Collaborator

andreiborisov commented Mar 19, 2019

What is probably happening is that fish reprints prompt on terminal resize, but we are only erasing current line before printing the prompt. As a result, the second line of the prompt gets updated, but the first one is not.

Can we even erase the previous line of the terminal?

If so, the first thing on my mind would be to test for a previously executed command to determine if it was pure invocation and then if it was to erase two lines instead of one.

@goranmoomin
Copy link
Author

@schrodincat Well, if it’s that case on every window resize that should happen, However that only happens on the first prompt: On second or third prompt, everything works as expected.

Sent with GitHawk

@andreiborisov
Copy link
Collaborator

Working on it

@andreiborisov
Copy link
Collaborator

@pcr910303 the issue is fixed in 2.1.2, please update pure with your favourite package manager and thanks for reporting!

@goranmoomin
Copy link
Author

@schrodincat Great! Can confirm it is fixed :-)

Sent with GitHawk

@jgierer12
Copy link

Not sure if this is the same issue, but pressing Ctrl + C while there is already some text written in the current command line still causes the wrong redraw with pure v2.1.2:

@andreiborisov
Copy link
Collaborator

andreiborisov commented Mar 21, 2019

@jgierer12 it's a different issue. Can you elaborate a bit more, what OS, terminal emulator and fish version are you using?

@jgierer12
Copy link

jgierer12 commented Mar 21, 2019

OS: Manjaro Linux x86_64 (Kernel: 5.0.1-1-MANJARO)
Terminal: GNOME Terminal (can also be observed in VSCode integrated terminal)
fish: version 3.0.2

I bound Ctrl + C to commandline "" to circumvent this but it would still be nice to get a 'proper' fix for it since it also happens other times when the commandline is redrawn, such as resizing the terminal window.

@johnfraney
Copy link

@schrodincat I can confirm this on Arch with Terminix, VS Code's integrated terminal, Gnome Terminal, and Guake running fish 3.0.2. It's happened with this theme as long as I can remember.

@andreiborisov
Copy link
Collaborator

@edouard-lopez do you have same issues on your Linux setup? It seems to be Linux specific, as I'm not experiencing this on macOS.

@edouard-lopez
Copy link
Member

Initial issue is solved. However, I can reproduce @jgierer12's one, I'm creating a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug something that doesn't works as expected 🙏 help wanted needs PR or help on decision
Projects
None yet
Development

No branches or pull requests

5 participants