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

COLUMNS incorrect for the first prompt in a session #4141

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

COLUMNS incorrect for the first prompt in a session #4141

soumya92 opened this issue Jun 18, 2017 · 2 comments
Assignees
Labels
bug
Milestone

Comments

@soumya92
Copy link
Contributor

@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
Copy link
Contributor

@krader1961 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
Copy link
Contributor Author

@soumya92 soumya92 commented Jun 18, 2017

Thanks for the quick fix! 🎉

@krader1961 krader1961 self-assigned this Jul 10, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.