[GH-ISSUE #73] Number of columns is off for maximized window ($COLUMNS=169) #670

Closed
opened 2026-03-15 08:47:37 +03:00 by kerem · 3 comments
Owner

Originally created by @blueyed on GitHub (Nov 11, 2014).
Original GitHub issue: https://github.com/asciinema/asciinema/issues/73

I am using the following code in my prompt, which results in $rprompt being right aligned:

PR_FILLBAR="%f${(l:(($TERMWIDTH - ( ($rprompt_len + $prompt_len) % $TERMWIDTH))):: :)}"
…
PROMPT="${prompt}${PR_FILLBAR}${rprompt}

With a maximized terminal window however, asciinema appears to not get the width of the window correct, where $rprompt is being cut off.

See the following screencast: https://asciinema.org/a/13845

Originally created by @blueyed on GitHub (Nov 11, 2014). Original GitHub issue: https://github.com/asciinema/asciinema/issues/73 I am using the following code in my prompt, which results in `$rprompt` being right aligned: ``` PR_FILLBAR="%f${(l:(($TERMWIDTH - ( ($rprompt_len + $prompt_len) % $TERMWIDTH))):: :)}" … PROMPT="${prompt}${PR_FILLBAR}${rprompt} ``` With a maximized terminal window however, asciinema appears to not get the width of the window correct, where `$rprompt` is being cut off. See the following screencast: https://asciinema.org/a/13845
kerem closed this issue 2026-03-15 08:47:52 +03:00
Author
Owner

@ku1ik commented on GitHub (Nov 11, 2014):

Where does the $TERMWIDTH var come from? Is it initially set by terminal emulator or by shell?

<!-- gh-comment-id:62641969 --> @ku1ik commented on GitHub (Nov 11, 2014): Where does the $TERMWIDTH var come from? Is it initially set by terminal emulator or by shell?
Author
Owner

@blueyed commented on GitHub (Nov 11, 2014):

It's derived from $COLUMNS:

local -h TERMWIDTH=$((${COLUMNS}-1))
<!-- gh-comment-id:62642390 --> @blueyed commented on GitHub (Nov 11, 2014): It's derived from $COLUMNS: ``` local -h TERMWIDTH=$((${COLUMNS}-1)) ```
Author
Owner

@ku1ik commented on GitHub (Dec 18, 2014):

Is this problem happening only during playback or it's already there when recording?

Please try the latest version and let me know if that's still the case.

<!-- gh-comment-id:67458580 --> @ku1ik commented on GitHub (Dec 18, 2014): Is this problem happening only during playback or it's already there when recording? Please try the latest version and let me know if that's still the case.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asciinema#670
No description provided.