Skip to content

Commit

Permalink
edit: work around WINCH not updating COLUMNS/LINES after "ble-reload"
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed May 11, 2020
1 parent 6ede0c7 commit a190455
Show file tree
Hide file tree
Showing 5 changed files with 555 additions and 4 deletions.
5 changes: 3 additions & 2 deletions memo/ChangeLog.md
Expand Up @@ -41,7 +41,7 @@
- edit (edit-and-execute): disable highlighting of old command line content `#D1295` 2f9a000
- util (`bleopt`): fail when a specified bleopt variable does not exist (test-util) 5966f22
- builtin: let redefined builtins return 2 for `--help` `#D1323` 731896c
- edit: preserve `PS1` when `internal_suppress_bash_output` is set `#D1344` 0000000
- edit: preserve `PS1` when `internal_suppress_bash_output` is set `#D1344` eba9b92

## Fix

Expand Down Expand Up @@ -85,13 +85,14 @@
- util (`ble-stackdump`): fix a shift of line numbers `#D1337` a14b72f
- edit (`ble-bind -x`): check range of `READLINE_{POINT,MARK}` `#D1339` efe1e81
- util (`ble/string#to{upper,lower}`): work around `LC_COLLATE=en_US.utf8` (test-util) `#D1341` e4c5861
- util (encoding, keyseq): fix miscelleneous encoding bugs (test-util) 0000000
- util (encoding, keyseq): fix miscelleneous encoding bugs (test-util) 560529c
- `ble/util/c2keyseq`: work around bash ambiguous keyseq `\M-\C-\\`
- `ble/util/c2keyseq`: fix a bug that `C1` characters are not properly encoded
- `ble/util/keyseq2chars`: fix a bug that `\xHH` is not properly processed
- `ble/encoding:UTF-8/b2c`: work around Bash-4.2 arithmetic crash
- `ble/encoding:UTF-8/b2c`: fix a bug that `G0` characters lose its seventh bit
- `ble/encoding:UTF-8/c2b`: fix a bug that the first byte gets redundant bits
- edit: work around `WINCH` not updating `COLUMNS`/`LINES` after `ble-reload` `#D1345` 0000000

## Compatibility

Expand Down
28 changes: 28 additions & 0 deletions memo/D1345.bashrc
@@ -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'

0 comments on commit a190455

Please sign in to comment.