Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
edit: work around WINCH not updating COLUMNS/LINES after "ble-reload"
- Loading branch information
1 parent
6ede0c7
commit a190455
Showing
5 changed files
with
555 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
shopt -s checkwinsize | ||
function p1 { | ||
echo "[$COLUMNS:$LINES] $READLINE_LINE" | ||
} | ||
function winch { | ||
trap -- 'echo "[$COLUMNS:$LINES] $READLINE_LINE (WINCH)"' WINCH | ||
} | ||
|
||
function handle-t { | ||
exec &>/dev/tty | ||
p1 | ||
exec &>/dev/null | ||
} | ||
function handle-u { | ||
exec &>/dev/tty | ||
p1 | ||
} | ||
function handle-h { | ||
exec &>/dev/tty | ||
exec &>/dev/null | ||
} | ||
winch | ||
|
||
bind -x '"\C-t": handle-t' | ||
bind -x '"\C-h": handle-h' | ||
bind -x '"\C-y": handle-u' |
Oops, something went wrong.