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

COLUMNS incorrect for the first prompt in a session #4141

Closed
soumya92 opened this Issue Jun 18, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@soumya92

soumya92 commented Jun 18, 2017

fish, version 2.6.0
macOS 10.12.5 (16F73)
iTerm2 Build 3.0.15

With a fish_prompt of

function fish_prompt
    echo "$COLUMNS > "
end

I see some weird behaviour. Specifically, the first prompt of any fish invocation prints 80, while subsequent prompts print 120 (actual width).

This happens for new tabs, new windows, and even nested fish shell invocations.

Pressing return, resizing the window (in either dimension), pasting something (presumably because of the syntax highlighting), or even pkill -SIGWINCH fish in another session, all fix the prompt.

I have a "-d 3" log of fish, where all I do is press return to update columns and then quit.

@krader1961 krader1961 added the bug label Jun 18, 2017

@krader1961 krader1961 added this to the fish 2.7.0 milestone Jun 18, 2017

@krader1961

This comment has been minimized.

Show comment
Hide comment
@krader1961

krader1961 Jun 18, 2017

Contributor

Good catch. Thanks for reporting this. It turns out that we currently don't interrogate the size of the terminal until after the first time fish_prompt is run when fish needs to decides whether its output will fit on the screen.

Contributor

krader1961 commented Jun 18, 2017

Good catch. Thanks for reporting this. It turns out that we currently don't interrogate the size of the terminal until after the first time fish_prompt is run when fish needs to decides whether its output will fit on the screen.

@soumya92

This comment has been minimized.

Show comment
Hide comment
@soumya92

soumya92 Jun 18, 2017

Thanks for the quick fix! 🎉

soumya92 commented Jun 18, 2017

Thanks for the quick fix! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment