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

commandline -f repaint breaks on multiline prompt #5860

Closed
nunzioc opened this issue May 4, 2019 · 5 comments
Closed

commandline -f repaint breaks on multiline prompt #5860

nunzioc opened this issue May 4, 2019 · 5 comments
Labels
bug Something that's not working as intended
Milestone

Comments

@nunzioc
Copy link
Contributor

nunzioc commented May 4, 2019

I'm using fish, version 3.0.2 on fedora 30 with gnome terminal.

I'm binding a command that changes the pwd. A simplified version is this:

function '__tmp_cd'
cd -
commandline -f repaint
end
bind \cc '__tmp_cd'

When using a multiline prompt (I'm using terlar), characters from the old prompt are visible after running the command when the new prompt is shorter than the old one.

@faho
Copy link
Member

faho commented May 5, 2019

Duplicate of #5033

@faho faho marked this as a duplicate of #5033 May 5, 2019
@faho faho closed this as completed May 5, 2019
@faho faho added the duplicate label May 5, 2019
@bruce-hill
Copy link

I believe this issue is not a duplicate of #5033 despite the similar bug titles. When redrawing a multi-line prompt in this fashion, fish is positioning the prompt correctly, but failing to fully erase the old prompt. A simple fix is to put \033[J (the escape sequence for "clear to bottom of screen") at the beginning of your prompt, but I think fish should do that clearing automatically, because the current behavior of commandline -f repaint is very counterintuitive.

My steps to reproduce:

function fish_prompt; printf "["(pwd)"]\n> "; end
bind \cB 'cd ..; commandline -f repaint'
cd /usr/local

Then hit Ctrl-b. The prompt will now display

[/usr]local]
>

instead of

[/usr]
>

A fixed version of the same prompt that has no issues: function fish_prompt; printf "\033[J["(pwd)"]\n> "; end

@zanchey zanchey reopened this Jun 14, 2019
@zanchey
Copy link
Member

zanchey commented Jun 14, 2019

Yes, I agree.

@rouge8
Copy link
Contributor

rouge8 commented Dec 18, 2020

This appears to be fixed as of 75dcbed 🎉

rouge8 added a commit to rouge8/dotfiles that referenced this issue Dec 18, 2020
@zanchey zanchey modified the milestones: fish-future, fish 3.2.0 Dec 27, 2020
@zanchey
Copy link
Member

zanchey commented Dec 27, 2020

Yep. This is actually a duplicate of #3550, I think!

@zanchey zanchey closed this as completed Dec 27, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something that's not working as intended
Projects
None yet
Development

No branches or pull requests

5 participants