mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 13:53:10 +00:00
Force termsize back to valid in get_current_winsize()
get_current_winsize() is intended to be lazy. It does the following: 1. Gets the termsize from the kernel 2. Compares it against the current value 3. If changed, sets COLUMNS and LINES variables Upon setting these variables, we notice that the termsize has changed and invalidate the termsize. Thus we were doing this work multiple times on every screen repaint. Put back an old hack that just marked the termsize as valid at the end of get_current_winsize().
This commit is contained in:
parent
e22422c073
commit
277db64804
1 changed files with 4 additions and 0 deletions
|
@ -1843,6 +1843,10 @@ struct winsize get_current_winsize() {
|
|||
// TODO: this may call us reentrantly through the environment dispatch mechanism. We need to
|
||||
// rationalize this.
|
||||
export_new_termsize(&termsize, vars);
|
||||
// Hack: due to the dispatch the termsize may have just become invalid. Stomp it back to
|
||||
// valid. What a mess.
|
||||
*s_termsize.acquire() = termsize;
|
||||
s_termsize_valid = true;
|
||||
}
|
||||
return termsize;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue