diff --git a/GNUmakefile b/GNUmakefile index 45c8a2da..af1c14b6 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -28,7 +28,7 @@ endif MWGPP:=$(GAWK) -f make/mwg_pp.awk -# Note (): we had used "cp -p xxx out/xxx" to copy files to the build +# Note (#D2058): we had used "cp -p xxx out/xxx" to copy files to the build # directory, but some filesystem (ecryptfs) has a bug that the subsecond # timestamps are truncated causing an issue: make every time copies all the # files into the subdirectory `out`. We give up using `cp -p` and instead copy diff --git a/contrib b/contrib index 897f8156..acf7b1cd 160000 --- a/contrib +++ b/contrib @@ -1 +1 @@ -Subproject commit 897f8156a55cfacafcb3fe5cf3eef0f7fe17589f +Subproject commit acf7b1cdb7112597242a8da106dfabf350ac79e6 diff --git a/docs/ChangeLog.md b/docs/ChangeLog.md index 0230e241..ab78e3e3 100644 --- a/docs/ChangeLog.md +++ b/docs/ChangeLog.md @@ -47,8 +47,8 @@ - keymap/vi: fix the behavior of text-object for quotes in xmap (reported by Darukutsu) `#D2094` 5f9a44ec - edit(redo): fix broken common prefix/suffix determination (reported by Darukutsu) `#D2098` c920ea65 - keymap/vi: improve text-object in omap for brackets (reported by Darukutsu) `#D2100` d1a1d538 -- decode(bind): fix command-line argument parsing `#D2107` xxxxxxxx -- edit(gexec): fix a bug that `LINENO` is vanishing `#D2108` xxxxxxxx +- decode(bind): fix command-line argument parsing `#D2107` 57a13c3c +- edit(gexec): fix a bug that `LINENO` is vanishing `#D2108` b5776596 ## Compatibility @@ -70,8 +70,9 @@ - global: adjust bash options for utilities outside the ble context (motivated by jkemp814) `#D2092` 6b144de7 - decode,syntax: quote `$#` in arguments properly `#D2097` 40a625d3 - global: work around case-interleaving collation (reported by dongxi8) `#D2103` a3b94bb3 -- nsearch: set `immediate-accept` for `empty=emulate-readline` (reported by blackteahamburger) `#D2104` xxxxxxxx -- decode(bind): support the colonless form of `bind -x` of bash-5.3 `#D2106` xxxxxxxx +- nsearch: set `immediate-accept` for `empty=emulate-readline` (reported by blackteahamburger) `#D2104` 870ecef7 +- decode(bind): support the colonless form of `bind -x` of bash-5.3 `#D2106` 78d7d2e3 +- decode, vi_digraph: trim CR of text resources in MSYS `#D2105` xxxxxxxx ## Contrib @@ -92,7 +93,7 @@ - test(bash): fix condition for bash bug of history expansion `#D2071` aacf1462 - test(main): fix delimiter of `MSYS` in adding `winsymlinks` `#D2071` aacf1462 -- test(util,vi): adjust `ble/util/is-stdin-ready` while testing `#D2105` xxxxxxxx +- test(util,vi): adjust `ble/util/is-stdin-ready` while testing `#D2105` 23a05827 xxxxxxxx ## Internal changes diff --git a/lib/keymap.vi_digraph.sh b/lib/keymap.vi_digraph.sh index 454ffa16..228d579b 100644 --- a/lib/keymap.vi_digraph.sh +++ b/lib/keymap.vi_digraph.sh @@ -40,6 +40,7 @@ function ble-decode/keymap:vi_digraph/define { local line field ch1 ch2 code for line in "${lines[@]}"; do [[ $line == ??' '* ]] || continue + [[ $OSTYPE == msys* ]] && line=${line%$'\r'} ch1=${line::1} ch2=${line:1:1} code=${line:3} diff --git a/lib/test-util.sh b/lib/test-util.sh index 138ce695..930cc0cd 100644 --- a/lib/test-util.sh +++ b/lib/test-util.sh @@ -1875,7 +1875,9 @@ fi ble-import FILE1.txt FILE2.txt -C 'ble/util/print both1' -C 'ble/util/print both2' ( - ble/test 'ble/util/idle.do' stdout= + if ble/is-function ble/util/idle.push; then + ble/test 'ble/util/idle.do' stdout= + fi ble/test 'ble-import FILE1.txt' stdout=$'FILE1\nloaded1\nloaded2\nloaded3\nloaded4' ble/test 'ble-import FILE2.txt' stdout=$'FILE2\nboth1\nboth2' ) @@ -1894,10 +1896,12 @@ fi ) # with -d option - ( - ble-import FILE1.txt FILE2.txt -dC 'ble/util/print both' - ble/test 'ble/util/idle.do' stdout=$'FILE1\nFILE2\nboth' - ) + if ble/is-function ble/util/idle.push; then + ( + ble-import FILE1.txt FILE2.txt -dC 'ble/util/print both' + ble/test 'ble/util/idle.do' stdout=$'FILE1\nFILE2\nboth' + ) + fi ble/test/rmdir ) diff --git a/note.txt b/note.txt index 225ed7a4..fd3c0846 100644 --- a/note.txt +++ b/note.txt @@ -7333,6 +7333,36 @@ bash_tips end-section でない時に正しく失敗が検出できていなかった。end-section 毎に失 敗 section 数をインクリメントする事にした。 + 2024-01-01 未だ失敗している。macos で失敗している。windows では一応成功はし + ているが変なエラーが発生している。macos の方については単に bash-3.2 だった + ので ble/util/idle.do が空実装になっていてそれを使ったテストが通っていない + だけだった。 + + windows の方についてはどうも rlfunc.txt の各行の末尾に \r がついているのが + 原因の様だ。然し、調べてみるとその他のファイルについても全部 \r がついてい + る様に見える。何故問題になっていないのか。bash が読み取る時にいい具合にして + くれるという事なのだろうか。 + + ? その他の自前で読み書きしているファイルについては大丈夫なのだろうか? →調 + べてみた所、自前で生成したファイルについては大丈夫だった。 + + 注意しなければならないファイルは rlfunc.txt, ignoreeof-messages.txt, + vi_digraph.txt である。rlfunc.txt については対策はできた。 + ignoreeof-messages.txt については行内の何処かに一致していれば良いという作 + 戦なので、余分な \r がついていてもちゃんと動作する。vi_digraph.txt につい + ては mapfile で読み取っているのでちゃんと調整が必要になる。 + + ? 或いは読み取る時の方法によって \r が除去されたりされなかったりする等の事 + があるのだろうか? もし mapfile だけで問題が起きるのだとしたらそれについて + もちゃんと対策をする必要が出てくる。 + + 既存のファイル keymap.vi_digraph.txt を使って確かめてみる事にした。実際に + keymap.vi_digraph.txt の中身も \r が付加されていて、更に read で読み取っ + たとしても \r が混入してしまうという事が確認できた。つまり、mapfile を使っ + たから悪いという訳ではない。 + + 修正した。 + * edit: history-search-backward に関する振る舞いに対する要望 (reported by blackteahamburger) [#D2104] https://github.com/akinomyoga/ble.sh/issues/382 diff --git a/src/decode.sh b/src/decode.sh index 616d146d..1d037c13 100644 --- a/src/decode.sh +++ b/src/decode.sh @@ -3718,6 +3718,7 @@ function ble/builtin/bind/rlfunc2widget { local line for line in "${dict[@]}"; do [[ $line == "$rlfunc "* ]] || continue + [[ $OSTYPE == msys* ]] && line=${line%$'\r'} local rl widget; ble/bash/read rl widget <<< "$line" if [[ $widget == - ]]; then ble/util/print "ble.sh (bind): unsupported readline function '${rlfunc//$q/$Q}' for keymap '$kmap'." >&2