diff --git a/LICENSE.md b/LICENSE.md index fe716608..60789a4f 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2013, 2015-2020, K. Murase @akinomyoga , +Copyright (c) 2013, 2015-2023, K. Murase @akinomyoga , All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/README-ja_JP.md b/README-ja_JP.md index ee7327c9..fbfefab8 100644 --- a/README-ja_JP.md +++ b/README-ja_JP.md @@ -100,7 +100,7 @@ echo 'source ~/.local/share/blesh/ble.sh' >> ~/.bashrc この方法では対応するパッケージ管理ツールのみが必要です。 -- [AUR (Arch Linux)](https://github.com/akinomyoga/ble.sh/wiki/Manual-A1-Installation#user-content-AUR) `blesh-git` (devel), `blesh` (stable 0.3.3) +- [AUR (Arch Linux)](https://github.com/akinomyoga/ble.sh/wiki/Manual-A1-Installation#user-content-AUR) `blesh-git` (devel), `blesh` (stable 0.3.4) - [NixOS (nixpkgs)](https://github.com/akinomyoga/ble.sh/wiki/Manual-A1-Installation#user-content-nixpkgs) `blesh` (devel) - [Guix](https://packages.guix.gnu.org/packages/blesh/0.4.0-devel2/) `blesh` (0.4.0-devel2) @@ -211,9 +211,9 @@ Vimモードの実装は2017年9月に始まり2018年3月に一先ず完成と 現在は漫然とメンテナンスしている所でいつになるかは分かりませんが、以下に挙げるような機能も加えたいと何となく考えています。 - 2013-06 v0.0 -- 実験 -- 2015-12 v0.1 -- 構文着色 [[v0.1.14](https://github.com/akinomyoga/ble.sh/releases/tag/v0.1.14)] -- 2018-03 v0.2 -- Vim モード [[v0.2.6](https://github.com/akinomyoga/ble.sh/releases/tag/v0.2.6)] -- 2019-02 v0.3 -- 拡張補完 [[v0.3.3](https://github.com/akinomyoga/ble.sh/releases/tag/v0.3.3)] +- 2015-12 v0.1 -- 構文着色 [[v0.1.15](https://github.com/akinomyoga/ble.sh/releases/tag/v0.1.15)] +- 2018-03 v0.2 -- Vim モード [[v0.2.7](https://github.com/akinomyoga/ble.sh/releases/tag/v0.2.7)] +- 2019-02 v0.3 -- 拡張補完 [[v0.3.4](https://github.com/akinomyoga/ble.sh/releases/tag/v0.3.4)] - 20xx-xx v0.4 (plan) -- プログラム着色 [[nightly build](https://github.com/akinomyoga/ble.sh/releases/tag/nightly)] - 20xx-xx v0.5 (plan) -- TUI設定画面 - 20xx-xx v0.6 (plan) -- エラー診断? @@ -289,29 +289,9 @@ Make 変数 `DESTDIR` または `PREFIX` が指定されている時、`ble.sh` 現在、安定版は開発版に比べてかなり古いので様々な機能が欠けている事にご注意下さい。 - 開発版 [v0.4.0-devel2](https://github.com/akinomyoga/ble.sh/releases/tag/v0.4.0-devel2) (2020-12), [nightly build](https://github.com/akinomyoga/ble.sh/releases/tag/nightly) -- 安定版 [v0.3.3](https://github.com/akinomyoga/ble.sh/releases/tag/v0.3.3) (2019-02 fork) 拡張補完 -- 安定版 [v0.2.6](https://github.com/akinomyoga/ble.sh/releases/tag/v0.2.6) (2018-03 fork) Vim モード -- 安定版 [v0.1.14](https://github.com/akinomyoga/ble.sh/releases/tag/v0.1.14) (2015-12 fork) 構文着色 - -## 1.2 `ble.sh` をダウンロードして試す (旧バージョン ble-0.3 201902版) - -`wget` を使う場合: -```console -$ wget https://github.com/akinomyoga/ble.sh/releases/download/v0.3.3/ble-0.3.3.tar.xz -$ tar xJf ble-0.3.3.tar.xz -$ source ble-0.3.3/ble.sh -``` -`curl` を使う場合: -```console -$ curl -LO https://github.com/akinomyoga/ble.sh/releases/download/v0.3.3/ble-0.3.3.tar.xz -$ tar xJf ble-0.3.3.tar.xz -$ source ble-0.3.3/ble.sh -``` - -指定したディレクトリに `ble.sh` を配置するには単に `ble-0.1.7` ディレクトリをコピーします。 -```console -$ cp -r ble-0.3.3 /path/to/blesh -``` +- 安定版 [v0.3.4](https://github.com/akinomyoga/ble.sh/releases/tag/v0.3.4) (2019-02 fork) 拡張補完 +- 安定版 [v0.2.7](https://github.com/akinomyoga/ble.sh/releases/tag/v0.2.7) (2018-03 fork) Vim モード +- 安定版 [v0.1.15](https://github.com/akinomyoga/ble.sh/releases/tag/v0.1.15) (2015-12 fork) 構文着色 ## 1.3 `.bashrc` に設定する @@ -710,3 +690,4 @@ GitHub の Issue/PR を通して多くの方からフィードバックを頂き - [`@rux616`](https://github.com/rux616) 様には幾つかの問題報告および `.blerc` の既定パス解決のバグ修正をいただきました。 - [`@timjrd`](https://github.com/timjrd) 様には補完の枠組みの高速化に関する PR をいただきました。 - [`@3ximus`](https://github.com/3ximus) 様には広範囲に渡る様々な問題について報告いただきました。 +- [`@SuperSandro2000`](https://github.com/SuperSandro2000) 様には NixOS 関係を始め様々なご報告をいただきました。 diff --git a/README.md b/README.md index 9b035842..1954fa2b 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,7 @@ echo 'source ~/.local/share/blesh/ble.sh' >> ~/.bashrc This only requires the corresponding package manager. -- [AUR (Arch Linux)](https://github.com/akinomyoga/ble.sh/wiki/Manual-A1-Installation#user-content-AUR) `blesh-git` (devel), `blesh` (stable 0.3.3) +- [AUR (Arch Linux)](https://github.com/akinomyoga/ble.sh/wiki/Manual-A1-Installation#user-content-AUR) `blesh-git` (devel), `blesh` (stable 0.3.4) - [NixOS (nixpkgs)](https://github.com/akinomyoga/ble.sh/wiki/Manual-A1-Installation#user-content-nixpkgs) `blesh` (devel) - [Guix](https://packages.guix.gnu.org/packages/blesh/0.4.0-devel2/) `blesh` (0.4.0-devel2) @@ -223,9 +223,9 @@ The implementation of vim mode has been started in September, 2017 and completed I started working on the enhancement of the completion in August, 2018 and released it in the next February. - 2013-06 v0.0 -- prototype -- 2015-12 v0.1 -- Syntax highlighting [[v0.1.14](https://github.com/akinomyoga/ble.sh/releases/tag/v0.1.14)] -- 2018-03 v0.2 -- Vim mode [[v0.2.6](https://github.com/akinomyoga/ble.sh/releases/tag/v0.2.6)] -- 2019-02 v0.3 -- Enhanced completion [[v0.3.3](https://github.com/akinomyoga/ble.sh/releases/tag/v0.3.3)] +- 2015-12 v0.1 -- Syntax highlighting [[v0.1.15](https://github.com/akinomyoga/ble.sh/releases/tag/v0.1.15)] +- 2018-03 v0.2 -- Vim mode [[v0.2.7](https://github.com/akinomyoga/ble.sh/releases/tag/v0.2.7)] +- 2019-02 v0.3 -- Enhanced completion [[v0.3.4](https://github.com/akinomyoga/ble.sh/releases/tag/v0.3.4)] - 20xx-xx v0.4 (plan) -- programmable highlighting [[nightly build](https://github.com/akinomyoga/ble.sh/releases/tag/nightly)] - 20xx-xx v0.5 (plan) -- TUI configuration - 20xx-xx v0.6 (plan) -- error diagnostics? @@ -304,9 +304,9 @@ For download, trial and install, see the description at each release page. The stable versions are significantly old compared to the devel version, so many features are unavailable. - Devel [v0.4.0-devel2](https://github.com/akinomyoga/ble.sh/releases/tag/v0.4.0-devel2) (2020-12), [nightly build](https://github.com/akinomyoga/ble.sh/releases/tag/nightly) -- Stable [v0.3.3](https://github.com/akinomyoga/ble.sh/releases/tag/v0.3.3) (2019-02 fork) Enhanced completions -- Stable [v0.2.6](https://github.com/akinomyoga/ble.sh/releases/tag/v0.2.6) (2018-03 fork) Vim mode -- Stable [v0.1.14](https://github.com/akinomyoga/ble.sh/releases/tag/v0.1.14) (2015-12 fork) Syntax highlighting +- Stable [v0.3.4](https://github.com/akinomyoga/ble.sh/releases/tag/v0.3.4) (2019-02 fork) Enhanced completions +- Stable [v0.2.7](https://github.com/akinomyoga/ble.sh/releases/tag/v0.2.7) (2018-03 fork) Vim mode +- Stable [v0.1.15](https://github.com/akinomyoga/ble.sh/releases/tag/v0.1.15) (2015-12 fork) Syntax highlighting ## 1.3 Set up `.bashrc` @@ -702,3 +702,4 @@ Among them, the following people have made particularly significant contribution - [`@rux616`](https://github.com/rux616) reported several issues and created a PR for fixing the default path of `.blerc` - [`@timjrd`](https://github.com/timjrd) suggested and contributed to performance improvements in completion. - [`@3ximus`](https://github.com/3ximus) reported many issues for a wide variety of problems. +- [`@SuperSandro2000`](https://github.com/SuperSandro2000) reported many issues related to NixOS and others diff --git a/docs/ChangeLog.md b/docs/ChangeLog.md index 04ce0256..343ff194 100644 --- a/docs/ChangeLog.md +++ b/docs/ChangeLog.md @@ -376,7 +376,7 @@ - complete (action:file): support `ble/syntax-raw` in the filename extraction (reported by qoreQyaS) `#D1921` 32277da - decode: fix a bug that the tab completion do not work with bash-4.4 and lower `#D1928` 7da9bce - complete: fix non-working ambiguous path completion with `..` and `.` in the path `#D1930` 632e90a -- main (`ble-reload`): fix failure by non-existent rcfile `#D1931` 0ceb0cb +- main (`ble-reload`): fix failure by non-existent rcfile `#D1931` b7ae2fa - syntax (`ble/syntax/highlight/vartype`): check variable in global scope `#D1932` b7026de - menu (linewise): fix layout calculation with variable width of line prefix (reported by bkerin) `#D1979` cc852dc - edit (`ble/textarea#render`): fix interleaving outputs to `_ble_util_buffer` and `DRAW_BUFF` `#D1987` 6d61388 @@ -564,6 +564,7 @@ - make: update lint check `#D1709` 7e26dcd - test: save the test log to a file `#D1735` d8e6ea7 - benchmark: improve determination of the base time `#D1737` ad866c1 +- make: add fallback Makefile for BSD make `#D1805` e5d8d00c - main: support `bleopt debug_xtrace` (requested by SuperSandro2000) `#D1810` 022d38b - test: clean up check failures by `make check` and `make scan` `#D1812` bb3e0a3 - util (`fd#alloc`): limit the search range of free fds `#D1813` 43be0e4 4c90072 diff --git a/docs/Release.md b/docs/Release.md index e950d82c..c3fe0663 100644 --- a/docs/Release.md +++ b/docs/Release.md @@ -1,3 +1,562 @@ +# ble-0.4.0-devel3 + +## Usage + +**Prerequisites** + +Bash 3.0+ and basic POSIX utilities are required. + +**Download ble-0.4.0-devel3.tar.xz** + +https://github.com/akinomyoga/ble.sh/releases/download/v0.4.0-devel3/ble-0.4.0-devel3.tar.xz + +```bash +# DOWNLOAD with wget +wget https://github.com/akinomyoga/ble.sh/releases/download/v0.4.0-devel3/ble-0.4.0-devel3.tar.xz + +# DOWNLOAD with curl +curl -LO https://github.com/akinomyoga/ble.sh/releases/download/v0.4.0-devel3/ble-0.4.0-devel3.tar.xz +``` + +**Trial & Install** + +```bash +# TRIAL +tar xJf ble-0.4.0-devel3.tar.xz +source ble-0.4.0-devel3/ble.sh + +# INSTALL (quick) +tar xJf ble-0.4.0-devel3.tar.xz -C ~/.local/share/blesh +echo 'source ~/.local/share/blesh' >> ~/.bashrc + +# INSTALL (more robust) +tar xJf ble-0.4.0-devel3.tar.xz -C ~/.local/share/blesh +# Add the following line near the top of ~/.bashrc +[[ $- == *i* ]] && source ~/.local/share/blesh/ble.sh --attach=none +# Add the following line at the end of ~/.bashrc +[[ ${BLE_VERSION-} ]] && ble-attach +``` + +-------------------------------------------------------------------------------- +# ble-0.3.4 + +## Usage + +**Prerequisites** + +Bash 3.0+ and basic POSIX utilities are required. + +**Download ble-0.3.4.tar.xz** + +https://github.com/akinomyoga/ble.sh/releases/download/v0.3.4/ble-0.3.4.tar.xz + +```bash +# DOWNLOAD with wget +wget https://github.com/akinomyoga/ble.sh/releases/download/v0.3.4/ble-0.3.4.tar.xz + +# DOWNLOAD with curl +curl -LO https://github.com/akinomyoga/ble.sh/releases/download/v0.3.4/ble-0.3.4.tar.xz +``` + +**Trial & Install** + +```bash +# TRIAL +tar xJf ble-0.3.4.tar.xz +source ble-0.3.4/ble.sh + +# INSTALL +tar xJf ble-0.3.4.tar.xz -C ~/.local/share/blesh +# Add the following line near the top of ~/.bashrc +[[ $- == *i* ]] && source ~/.local/share/blesh/ble.sh --attach=none +# Add the following line at the end of ~/.bashrc +[[ ${BLE_VERSION-} ]] && ble-attach +``` + +## blesh-0.3 Fixes +- decode: fix `bind` emulation in .bashrc (v0.3) 742777e +- global: pick fixes and changes from ble-0.1..0.2 backports 78bbc5e +- bump 0.3.4 9da6774 + +## Fixes +- complete: fix a problem that candidates are not updated after menu-filter (reported by 3ximus) `#D1428` 1c7786e (master: 98fbc1c) +- edit: work around the wrong job information of Bash in trap handlers (reported by 3ximus) `#D1435` `#D1436` d40847f (master: bc4735e) +- edit (command-help): work around the Bash bug that tempenv vanishes with `builtin eval` `#D1438` cc8ca96 (master: 8379d4a) +- global: suppress missing locale errors (reported by 3ximus) `#D1440` b52a798 (master: 4d3c595) +- edit (sword): fix definition of `sword` (shell words) `#D1441` 2370bce (master: f923388) +- edit (`kill-forward-logical-line`): fix a bug not deleting newline at the end of the line `#D1443` 2a8a7f6 (master: 09cf7f1) +- global: work around bash-4.2 bug of `declare -gA` (reported by 0xC0ncord) `#D1470` 2f85ed3 (master: 8856a04) +- global: fix declaration of associative arrays for `ble-reload` (reported by 0xC0ncord) `#D1471` 422de69 (master: 3cae6e4) +- util (`ble/util/msleep`): fix hang in Cygwin by swithing from `/dev/udp/0.0.0.0/80` to `/dev/zero` `#D1452` 5ace564 (master: d4d718a) +- syntax: fix broken AST with `[[` keyword `#D1454` 1d48e79 (master: 69658ef) +- benchmark (`ble-measure`): work around a locale-dependent decimal point of `EPOCHREALTIME` (reported by 3ximus) `#D1460` f3833ad (master: 1aa471b) +- util (`ble/util/msleep`): work around the bash-4.3 bug of `read -t` (reported by 3ximus) `#D1468` `#D1469` 70797cf (master: 4ca9b2e) +- bind: work around broken `cmd_xmap` after switching the editing mode `#D1478` 909f461 (master: 8d354c1) +- edit: clear graphic rendition on newlines and external commands `#D1479` 59ede5c (master: 18bb2d5) +- decode (rlfunc): work around incomplete bytes in keyseq (reported by onelittlehope) `#D1483` 948a38d (master: 3559658) beb0383 37363be +- canvas: fix a glitch that SGR at the end of command line is applied to new lines `#D1498` 6871634 (master: 4bdfdbf) +- syntax: fix a bug that `eval() { :; }`, `declare() { :; }` are not treated as function definition `#D1529` 6c1d295 (master: b429095) +- decode: fix a hang on attach failure by cache corruption `#D1531` d4b0700 (master: 24ea379) +- progcomp: fix non-working `complete -C prog` (reported by Archehandoro) `#D1535` 47b3ade (master: 026432d) +- bind: fix a problem that `bind '"seq":"key"'` causes a loop macro `bind -s key key` (reported by thanosz) `#D1536` e2a502d (master: ea05fc5) +- main: work around `. ble.sh --{test,update,clear-cache}` in intereactive sessions `#D1555` 500915f (master: bbc2a90) +- main: fix reloading after ble-update (fixup 500915f (master: bbc2a90)) (fixed by oc1024) `#D1558` 9372670 +- main: fix exit status for `bash ble.sh --test` (fixup 500915f (master: bbc2a90)) `#D1558` 641238a +- main: work around sourcing `ble.sh` inside subshells `#D1554` 500915f (master: bbc2a90) +- global: use a better workaround of bash-4.2 `declare -gA` by separating assignment `#D1567` 40827ef (master: 2408a20) +- util: work around bash-3.0 bug `"${scal[@]/xxx}"` `#D1570` 7e10cf4 (master: 24f79da) +- syntax: fix a bug that argument completion is attempted in nested commands (reported by huresche) `#D1579` 6987ae8 (master: 301d40f) +- edit (brackated-paste): fix incomplete `CR => LF` conversion (reported by alborotogarcia) `#D1587` 2651c8e (master: 8d6da16) +- main (adjust-bash-options): adjust `LC_COLLATE=C` `#D1588` 94cc9d2 (master: e87ac21) +- highlight (`layer:region`): fix blocked lower-layer changes without selection changes `#D1596` d40d42a (master: 5ede3c6) +- complete (`auto-menu`): fix sleep loops by clock/sclock difference `#D1597` 0abc15b (master: 53dd018) +- util: work around the Bash 3 bug of array assignments with `^A` and `^?` in Bash 3.2 `#D1614` 0eac4df (master: b9f7611) +- benchmark (`ble-measure`): fix a bug that the result is always 0 in Bash 3 and 4 (fixup bbc2a904) `#D1615` bc3cdab (master: a034c91) +- decode, canvas, etc.: explicitly treat CSI arguments as decimal numbers (reported by GorrillaRibs) `#D1625` 97bce68 (master: c6473b7) 2ea48d7 +- edit: fix a bug that `command-help` doesn't work `#D1635` c375fbb (master: 0f6a083) +- complete: fix a task scheduling bug of referencing two different clocks (reported by rashil2000) `#D1636` df9f932 (master: fea5f5b) +- canvas: update prompt trace on `char_width_mode` change (reported by Barbarossa93) `#D1642` 00f9ce8 (master: 68ee111) +- decode: fix a bug that the characters input while initialization are delayed `#D1670` 734bd50 (master: 430f449) +- util (`ble/util/readfile`): fix a bug of always exiting with 1 in `bash <= 3.2` (reported by laoshaw) `#D1678` 51d244a (master: 61705bf) +- trace: fix wrong positioning of the ellipses on overflow `#D1684` dea87c7 (master: b90ac78) +- mandb: generate completions of options also for the empty word `#D1689` dea87c7 (master: b90ac78) +- complete: do not generate keywords for quoted command names `#D1691` 5b1e5be (master: 60d244f) +- menu (menu-style:align): fix the failure of delaying `ble/canvas/trace` on items (motivated by banoris) `#D1710` 3d56593 (master: acc9661) +- complete: fix empty completions with `FIGNORE` (reported by seanfarley) `#D1711` 49e75ee (master: 144ea5d) +- main: fix the message of owner errors of cache directories (reported by zim0369) `#D1712` 02aeb4a (master: b547a41) +- util (`ble/string#escape-for-bash-specialchars`): fix escaping of TAB `#D1713` accf8f3 (master: 7db3d2b) +- util (visible-bell): erase visible-bell before running external commands `#D1723` 72a11ae (master: 0da0c1c) +- util (`ble/function`): work around `shopt -u extglob` `#D1725` 3819e83 (master: 952c388) +- syntax: fix uninitialized syntax-highlighting in bash-3.2 `#D1731` 7bd03a5 (master: e3f5bf7) +- main: fix the workaround for `set -eu` and refactor `#D1743` a949af0 (master: 6a946f0) +- progcomp: retry completions on `$? == 124` also for non-default completions (reported by SuperSandro2000) `#D1759` e217932 (master: 82b9c01) +- util (`ble/util/import`): work around filenames with bash special characters `#D1763` 4179e3d (master: b27f758) +- edit: fix the restore failure of `PS1` and `PROMPT_COMMAND` on `ble-detach` `#D1784` 4f4c924 (master: b9fdaab) +- complete: do not attempt an independent rhs completion for arguments (reported by rsteube) `#D1787` 7bf32ca (master: f8bbe2c) +- history: work around possible dirty prefix `*` in the history output `#D1808` 84184ce (master: 64a740d) +- util(`ble/util/eval-pathname-expansion`): fix restoring shopt options in bash-4.0 `#D1825` d3b3f7b (master: 736f4da) +- decode: fix the workaround for `set -e` with `--prompt=attach` `#D1832` 51cb735 (master: 5111323) +- decode (`encoding:C`): fix initialization for isolated ESC `#D1839` aaa74b5 (master: c3bba5b) +- main. util: fix problems of readlink etc. found by test in macOS (reported by aiotter) `#D1849` a1adc7f (master: fa955c1) `#D1855` a22e145 +- progcomp: fix a bug that `COMP_WORDBREAKS` is ignored `#D1872` b338066 (master: 4d2dd35) +- global: quote `return $?` `#D1884` 4f14f7a (master: 801d14a) +- main: fix adjustments of bash options (reported by rashil2000) `#D1895` 7bd25c9 (master: 138c476) +- decode: fix a bug that the tab completion do not work with bash-4.4 and lower `#D1928` 6351e7f (master: 7da9bce) +- bind: fix M-C-@, C-x C-@, and M-C-x (`bash-4.2 -o emacs`) `#D1920` 02f45f3 (master: a410b03) +- complete: fix non-working ambiguous path completion with `..` and `.` in the path `#D1930` fdb76e9 (master: 632e90a) +- main (ble-reload): fix failure by non-existent rcfile `#D1931` 58de996 (master: b7ae2fa) +- util: fix ble/util/clock in bash-4.2 [main: fix the timestamp in the session ID in bash-4.2] `#D1954` 9a24b1e (master: 651c70c1) +- edit (`ble/textarea#render`): fix interleaving outputs to `_ble_util_buffer` and `DRAW_BUFF` `#D1987` 62519a7 (master: 6d61388) +- keymap/vi (`operator:filter`): do not append newline at the end of line `#D1994` 8207d4f (master: bce2033) +- keymap/vi (`expand-range-for-linewise-operator`): fix the end point being not extended `#D1994` 8207d4f (master: bce2033) +- syntax: fix unrecognized asignment `echo arr[i]+=rhs` [sabbrev: apply sabbrev to right-hand sides of variable assignments] `#D2007` 948f50f (master: 41faa494) + +## Changes +- syntax: exclude \\ + LF at the word beginning from words (motivated by cmplstofB) `#D1431` 1b00fd2 (master: 67e62d6) +- edit: preserve the state of `READLINE_{LINE,POINT,MARK}` `#D1437` cc8ca96 (master: 8379d4a) +- edit: change default behavior of C-w and M-w to operate on backward words `#D1448` b1fd84a (master: 47a3301) +- edit (`ble/builtin/read`): cancel by C-d on an empty line `#D1473` 4fae77a (master: ecb8888) +- syntax: change syntax context after `time ;` and `! ;` for Bash 4.4 `#D1477` e55e3df (master: 4628370) +- decode (rlfunc): update mapping `vi-replace` in `imap` and `vi-editing-mode` in `nmap` (reported by onelittlehope) `#D1484` 3a2d0fe (master: f2ca811) +- prompt: invalidate prompt and textarea on prompt setting changes `#D1492` e28f330 (master: 1f55913) +- main: accept non-regular files as `blerc` and add option `--norc` `#D1530` 4b0eb87 (master: 7244e2f) +- prompt: adjust behavior of `LINENO` and prompt sequence `\#` (reported by tycho-kirchner) `#D1542` f3668ba (master: 8b0257e) +- main: show notifications against debug versions of Bash `#D1612` 0ee8415 (master: 8f974aa) +- edit: suppress only `stderr` with `internal_suppress_bash_output` (motivated by rashil2000) `#D1646` b0a9021 (master: a30887f) +- prompt: do not evaluate `PROMPT_COMMAND` for subprompts `#D1654` 9c0e515 (master: 08e903e) +- main: suppress non-interactive warnings from manually sourced startup files (reported by andreclerigo) `#D1676` a602876 (master: 0525528) 88e2df5 +- main: suppress non-interactive warnings from manually sourced startup files (reported by andreclerigo) `#D1676` 0525528 79efd42 (master: 88e2df5) +- syntax: revert 99f2234 (master: 371a5a4) and generate empty completion source on syntax error `#D1609` e09fcab +- syntax: do not start argument completions immediately after previous word (reported by EmilySeville7cfg) `#D1690` 99f2234 (master: 371a5a4) +- syntax: revert 371a5a4 and generate empty completion source on syntax error `#D1609` a1d1286 (master: e09fcab) +- canvas: do not insert explicit newlines on line folding if possible (reported by banoris) `#D1745` d878fce (master: 02b9da6) dc3827b +- edit (`ble-bind -x`): preserve multiline prompts on execution of `bind -x` commands (requested by SuperSandro2000) `#D1755` 240bfaa (master: 7d05a28) +- util (`ble/util/buffer`): hide cursor in rendering `#D1758` 5907567 (master: e332dc5) +- complete (`action:file`): always suffix `/` to complete symlinked directory names (reported by SuperSandro2000) `#D1759` ebdc58b (master: 397ac1f) +- edit: fix layout with `prompt_rps1` caused by missing `opts=relative` for `ble/textmap#update` `#D1769` e799191 (master: f6af802) +- edit (`ble-detach`): prepend a space to `stty sane` for `HISTIGNORE=' *'` `#D1796` 31bc2b7 (master: 26b532e) +- edit: the widgets `{kill,copy,delete}-region-or` now receives widgets as arguments `#D1021` e222c48 (master: bbbd155) +- decode (`bind`): do not treat non-beginning `#` as comments `#D1820` f9db7d8 (master: 65c4138) +- history: disable the history file when `HISTFILE` is empty `#D1836` 7153250 (master: 9549e83) +- main (`ble-reload`): preserve the original initialization options `#D1852` 8912d81 (master: d8c92cc) +- progcomp: reproduce arguments of completion functions passed by Bash `#D1872` b338066 (master: 4d2dd35) +- color: let `bleopt term_index_colors` override the default if specified `#D1878` e7c657c (master: 7d238c0) +- decode (`vi_imap-rlfunc.txt`): update the widget for `backward-kill-word` as `kill-backward-{u => c}word` `#D1896` 3c4e3a4 (master: e19b796) +- term (`_ble_term_TERM`): detect wezterm-20220408 `#D1909` f3a8382 (master: 486564a) +- keymap/vi (`decompose-meta`): translate S-a to A `#D1988` 9e0c187 (master: 600e845) +- term (`_ble_term_TERM`): detect konsole `#D1988` 9e0c187 (master: 600e845) ed53858 + +## Compatibility +- term: work around leaked DA2R in screen from outside terminal `#D1485` 4d77fab (master: e130619) +- util (`modifyOtherKeys`): work around a quirk of kitty (reported by NoahGorny) `#D1549` 823eb83 (master: f599525) +- global: work around empty `vi_imap` cache by `tmux-resurrect` `#D1562` d7d2a23 (master: 560160b) +- decode: identify `kitty` and treat `\e[27u` as isolated ESC (reported by lyiriyah) `#D1585` 2f7404e (master: c2a84a2) +- complete: suppress known error messages of `bash-completion` (reported by oc1024, Lun4m) `#D1622` 558322c (master: d117973) +- util (`modifyOtherKeys`): update the workaround for a new quiark of kitty `#D1627` 90d9284 (master: 3e4ecf5) +- main: work around `set -B` and `set -k` `#D1628` 55494eb (master: a860769) +- term: disable `modifyOtherKeys` and do not send `DA2` for `st` (requested by Shahabaz-Bagwan) `#D1632` 7e08766 (master: 92c7b26) +- cmap: add `st`-specific escape sequences for cursor keys `#D1633` 1391c90 (master: acfb879) +- cmap: distinguish find/select from home/end for openSUSE `inputrc.keys` (reported by cornfeedhobo) `#D1648` 886cc07 (master: c4d28f4) +- cmap: freeze the internal codes of find/select and kitty special keys `#D1674` 7d02058 (master: fdfe62a) +- decode: work around the overwritten builtin `set` (reported by eadmaster) `#D1680` 5acb117 (master: a6b4e2c) +- util (`modifyOtherKeys`): use the kitty protocol for kitty 0.23+ which removes the support of `modifyOtherKeys` (reported by kovidgoyal) `#D1681` 696264b (master: ec91574) +- complete: work around the variable leaks by `virsh` completion from `libvirt` (reported by telometto) `#D1682` 7a65fc3 (master: f985b9a) +- stty: do not remove keydefs for C-u, C-v, C-w, and C-? (reported by laoshaw) `#D1683` ff8fb83 (master: 82f74f0) +- decode (`ble/builtin/bind`): improve compatibility of the deprecated form `bind key:rlfunc` (motivated by cmplstofB) `#D1698` c3904ff (master: b6fc4f0) +- main: work around `XDG_RUNTIME_DIR` of a different user by `su` (reported by zim0369) `#D1712` dbf58e4 (master: 8d37048) +- main (`ble/util/readlink`): work around non-standard or missing `readlink` (motivated by peterzky) `#D1720` 60595bd (master: a41279e) +- decode (`ble/builtin/bind`): fix a bug that only lowercase is accepted for deprecated form `bind key:rlfunc` (reported by returntrip) `#D1726` 43cf9b9 (master: a67458e) e363f1b +- decode (`ble/builtin/bind`): fix a bug that only lowercase is accepted for deprecated form `bind key:rlfunc` (reported by returntrip) `#D1726` a67458e dd358d7 (master: e363f1b) +- global: work around the arithmetic syntax error of `10#` in Bash-5.1 `#D1734` b321b57 (master: 7545ea3) +- global: adjust implementations for Bash 5.2 `patsub_replacement` `#D1738` 66ae615 (master: 4590997) +- main: check `/dev/tty` on startup (reported by andychu) `#D1749` e6c2855 (master: 711c69f) +- global: work around `shopt -s compat42` `#D1754` 1f254b5 (master: a75bb25) +- global: identify bash-4.2 bug that internal quoting of `${v/%$empty/"$rep"}` remains `#D1753` 1f254b5 (master: a75bb25) +- prompt: fix a bug of `ble/prompt/print` redundantly quoting `$` `#D1752` 1f254b5 (master: a75bb25) +- global: work around `compat42` quoting of `"${v/pat/"$rep"}"` `#D1751` 1f254b5 (master: a75bb25) +- util: add identification of Windows Terminal `wt` `#D1758` 5907567 (master: e332dc5) +- global: work around bash-3.0 bug that single quotes remains for `"${v-$''}"` `#D1774` 30440b2 (master: 9b96578) +- util (`modifyOtherKeys`): fix a bug that kitty protocol is never activated `#D1842` f8aeb51 (master: 14f3c81) +- util (`modifyOtherKeys`): work around delayed terminal identification `#D1842` f8aeb51 (master: 14f3c81) +- main: resolve empty `HOSTNAME` [originally: contrib: add `histdb`] `#D1925` e82230e (master: 44d9e104) +- main: warn empty `LANG` [originally: main: support an option `--inputrc={diff,all,user,none}`] `#D1926` ede4ee7 (master: 92f2006) +- term (`terminology`): work around terminal glitches `#D1946` ccb93a5 (master: 9a1b4f9) +- edit: always adjust the terminal states with `bind -x` (reported by linwaytin) `#D1983` 992131c (master: 5d14cf1) +- syntax: suppress brace expansions in designated array initialization in Bash 5.3 `#D1989` 1f0d8e1 (master: 1e7b884) +- util (function#evaldef): work around `set -e` [progcomp: work around slow `nix` completion] `#D1997` 2ab4e4b (master: 2c1aacfc) +- util (`string#quote-word`): work around `set -ue` [util, edit: add `ble/util/message` and `ble append-line`] `#D2001` 2317562 (master: 2a524f34) +- complete: suppress error messages from `_adb` `#D2005` 2f77171 (master: f2aa32b) +- edit: restore `PS1` while processing `bind -x` `#D2024` 604c092 (master: 2eadcd5) + +## Optimization +- complete (`ble/complete/source:file`): remove slow old codes (reported by timjrd) `#D1512` 60a33e2 (master: e5be0c1) +- util (`ble/util/assign`): work around subshell conflicts `#D1578` 4117d1b (master: 6e4bb12) +- prompt: fix not properly set `$?` in `${PS1@P}` evaluation (reported by nihilismus) `#D1644` a3cfd0d (master: 521aff9) +- util (`ble/string#split`): optimize `#D1826` 9dcbbd4 (master: 7bb10a7) +- debug: add `ble/debug/profiler` (motivated by SuperSandro2000) `#D1824` f629698 11aa4ab 9dcbbd4 (master: 7bb10a7) +- global: avoid passing arbitrary strings through `awk -v var=value` `#D1827` 9edb1aa (master: 82232de) + +## Internal changes and fixes +- main: include hostname in local runtime directory `#D1444` 3e648a9 (master: 6494836) +- benchmark (`ble-measure`): support `-T TIME` and `-B TIME` option `#D1460` f3833ad (master: 1aa471b) +- global: fix status check for read timeout `#D1467` f190f9a (master: e886883) +- util, etc: ensure each function to work with arbitrary `IFS` `#D1490` `#D1491` c33fad0 (master: 5f9adfe) +- global: work around `localvar_inherit` for varname-list init `#D1566` 8c67b79 (master: 5c2edfc) +- util: fix `ble/util/dense-array#fill-range` e397120 (master: a46fdaf) +- util: fix leak variables `buff`, `trap`, `{x,y}{1,2}` `#D1572` 82113e9 (master: 5967d6c) +- util: fix leak variables `#D1643` 0817df6 (master: fcf634b) +- edit (`command-help`): use `ble/util/assign/.mktmp` to determine the temporary filename `#D1663` 2ff6078 (master: 1af0800) +- Makefile: add fallback Makefile for BSD make `#D1805` ea8b966 (master: e5d8d00) +- util, decode, vi: fix leak variables `#D1933` 9e2e823 (master: 8d5cab8) +- syntax: fix code formatting [originally: complete: support auto-complete sources] `#D1938` 450f70b (master: 00cae745) +- main: use builtin for ":" [histdb: support timeout of background processes] `#D1971` 482ddb5 (master: e0566bdc) +- global: normalize to `_a-zA-Z` [sabbrev: apply sabbrev to right-hand sides of variable assignments] `#D2006` a101fe6 (master: 41faa494) +- util (restore-vars): work around `set -u` [lib: add `util.bgproc` for `ble/util/bgproc`] `#D2017` 8787ca5 (master: 7803305f) +- util: update `ble/util/conditional-sync` [util.bgproc: increase frequency of bgproc termination check] `#D2027` 79fd13c (master: 8d623c1) + +## Test +- util (ble/util/s2bytes): clear locale cache `#D1881` 45f3df3 (master: 2e1a7c1) +- util (ble/util/s2c): work around intermediate mbstate of bash <= 5.2 `#D1881` 45f3df3 (master: 2e1a7c1) +- util (ble/encoding:UTF-8/b2c): fix interpretation of leading byte `#D1881` 45f3df3 (master: 2e1a7c1) +- complete: fix syntax error for bash-3.0 `#D1881` b534799 (master: 0b3e611) + +## Documentation +- blerc: rename from `blerc` to `blerc.template` `#D1899` 3c4e3a4 (master: e19b796) +- wiki/Q&A: add item for defining a widget calling multiple widgets (motivated by micimize) `#D1898` 3c4e3a4 (master: e19b796) +- blerc: add frequently used keybindings (motivated by KiaraGrouwstra, micimize) `#D1896` `#D1897` 3c4e3a4 (master: e19b796) + +## Contrib +- fzf-key-bindings: fix a problem that `modifyOtherKeys` is not reflected (reported by SuperSandro2000) `#D1908` f3a8382 (master: 486564a) + +## New features +- canvas: update emoji database and support `bleopt emoji_version` (motivated by endorfina) `#D1454` 3f6c9b9 (master: d1f8c27) +- syntax: support tilde expansions in parameter expansions `#D1513` e32914f (master: 0506df2) +- prompt (`contrib/prompt-git`): support dirty checking `#D1601` 50a0094 (master: b2713d9) +- util (`bleopt`, `bind`): fix error message and exit status, respectively `#D1640` 29728b1 (master: b663cee) +- edit: support bash-5.2 binding of `prior/next` to `history-search-{for,back}ward` `#D1661` a3a353e (master: d26a6e1) +- util: suppress false warnings of `bind` inside non-interactive shells (reported by wukuan405) `#D1823` 82c9934 (master: 1e19a67) +- auto-complete: cancel auto-complete for `magic-space` `#D1913` 05c0888 (master: 01b4f67) +- complete: support ambiguous completion for command paths `#D1922` 6d1e1ba (master: 8a716ad) +- syntax: support context after `((...))` and `[[ ... ]]` in bash-5.2 `#D1962` 57d7674 (master: 67cb967) + +-------------------------------------------------------------------------------- +# ble-0.2.7 + +## Usage + +**Prerequisites** + +Bash 3.0+ and basic POSIX utilities are required. + +**Download ble-0.2.7.tar.xz** + +https://github.com/akinomyoga/ble.sh/releases/download/v0.2.7/ble-0.2.7.tar.xz + +```bash +# DOWNLOAD with wget +wget https://github.com/akinomyoga/ble.sh/releases/download/v0.2.7/ble-0.2.7.tar.xz + +# DOWNLOAD with curl +curl -LO https://github.com/akinomyoga/ble.sh/releases/download/v0.2.7/ble-0.2.7.tar.xz +``` + +**Trial & Install** + +```bash +# TRIAL +tar xJf ble-0.2.7.tar.xz +source ble-0.2.7/ble.sh + +# INSTALL +tar xJf ble-0.2.7.tar.xz -C ~/.local/share/blesh +# Add the following line near the top of ~/.bashrc +[[ $- == *i* ]] && source ~/.local/share/blesh/ble.sh --noattach +# Add the following line at the end of ~/.bashrc +((_ble_bash)) && ble-attach +``` + +## blesh-0.2 fixes +- global: fix `ble/{is- => util/is}function` 5e82ca7a +- global: pick fixes and changes from ble-0.1 backports 013eb1cd +- complete: fix up 4df15e1e f02bd2a5 +- bump 0.2.7 1118c803 + +## Fixes +- edit: work around the wrong job information of Bash in trap handlers (reported by 3ximus) `#D1435` `#D1436` 795a647c (master: bc4735e0) +- edit (sword): fix definition of `sword` (shell words) `#D1441` 5e73cf6b (master: f9233889) +- edit (`kill-forward-logical-line`): fix a bug not deleting newline at the end of the line `#D1443` 03787a2d (master: 09cf7f14) +- global: work around bash-4.2 bug of `declare -gA` (reported by 0xC0ncord) `#D1470` a2ace444 (master: 8856a04f) +- global: fix declaration of associative arrays for `ble-reload` (reported by 0xC0ncord) `#D1471` 533eba77 (master: 3cae6e4d) +- util (`ble/util/msleep`): fix hang in Cygwin by swithing from `/dev/udp/0.0.0.0/80` to `/dev/zero` `#D1452` 46992e79 (master: d4d718ab) +- syntax: fix broken AST with `[[` keyword `#D1454` 0482bf64 (master: 69658efc) +- util (`ble/util/msleep`): work around the bash-4.3 bug of `read -t` (reported by 3ximus) `#D1468` `#D1469` fad78ea5 (master: 4ca9b2e2) +- bind: work around broken `cmd_xmap` after switching the editing mode `#D1478` 97ca1171 (master: 8d354c1b) +- edit: clear graphic rendition on newlines and external commands `#D1479` 759b96dd (master: 18bb2d5c) +- canvas: fix a glitch that SGR at the end of command line is applied to new lines `#D1498` a6ac1216 (master: 4bdfdbf8) +- syntax: fix a bug that `eval() { :; }`, `declare() { :; }` are not treated as function definition `#D1529` a4cda9c3 (master: b4290958) +- decode: fix a hang on attach failure by cache corruption `#D1531` a4c13ab8 (master: 24ea3792) +- benchmark (`ble-measure`): fix a bug that the result is always 0 in Bash 3 and 4 (fixup 8eb493a9 (master: bbc2a904)) `#D1615` a034c91 +- main: work around `. ble.sh --{test,update,clear-cache}` in intereactive sessions `#D1555` 8eb493a9 (master: bbc2a904) +- main: fix reloading after ble-update (fixup 8eb493a9 (master: bbc2a904)) (fixed by oc1024) `#D1558` 9372670 +- main: fix exit status for `bash ble.sh --test` (fixup 8eb493a9 (master: bbc2a904)) `#D1558` 641238a +- main: work around sourcing `ble.sh` inside subshells `#D1554` 8eb493a9 (master: bbc2a904) +- global: use a better workaround of bash-4.2 `declare -gA` by separating assignment `#D1567` 0b7de999 (master: 2408a207) +- edit (brackated-paste): fix incomplete `CR => LF` conversion (reported by alborotogarcia) `#D1587` ac738bb4 (master: 8d6da161) +- highlight (`layer:region`): fix blocked lower-layer changes without selection changes `#D1596` 650140ff (master: 5ede3c69) +- util: work around the Bash 3 bug of array assignments with `^A` and `^?` in Bash 3.2 `#D1614` 0ed7f6dc (master: b9f76118) +- benchmark (`ble-measure`): fix a bug that the result is always 0 in Bash 3 and 4 (fixup bbc2a904) `#D1615` 28e8dfed (master: a034c91a) +- decode, canvas, etc.: explicitly treat CSI arguments as decimal numbers (reported by GorrillaRibs) `#D1625` c9e4198b (master: c6473b78) 2ea48d7 +- edit: fix a bug that `command-help` doesn't work `#D1635` b992bb5d (master: 0f6a0834) +- canvas: update prompt trace on `char_width_mode` change (reported by Barbarossa93) `#D1642` 56b77a83 (master: 68ee1112) +- util (`ble/util/readfile`): fix a bug of always exiting with 1 in `bash <= 3.2` (reported by laoshaw) `#D1678` 5b843bb6 (master: 61705bf6) +- complete: do not generate keywords for quoted command names `#D1691` 7211b1ec (master: 60d244fe) +- complete: fix empty completions with `FIGNORE` (reported by seanfarley) `#D1711` 90f388aa (master: 144ea5db) +- main: fix the message of owner errors of cache directories (reported by zim0369) `#D1712` d2bf86c1 (master: b547a41a) +- syntax: fix uninitialized syntax-highlighting in bash-3.2 `#D1731` 6aa12c82 (master: e3f5bf74) +- progcomp: retry completions on `$? == 124` also for non-default completions (reported by SuperSandro2000) `#D1759` c641fb1b (master: 82b9c011) +- util (`ble/util/import`): work around filenames with bash special characters `#D1763` 7da5f048 (master: b27f7585) +- edit: fix the restore failure of `PS1` and `PROMPT_COMMAND` on `ble-detach` `#D1784` 47dfdd94 (master: b9fdaabd) +- history: work around possible dirty prefix `*` in the history output `#D1808` cc14f59c (master: 64a740d7) +- decode: fix the workaround for `set -e` with `--prompt=attach` `#D1832` 958aae6b (master: 51113237) +- main. util: fix problems of readlink etc. found by test in macOS (reported by aiotter) `#D1849` 8f0acf3d (master: fa955c1a) `#D1855` a22e145 +- global: quote `return $?` `#D1884` 9e10b54b (master: 801d14af) +- bind: fix M-C-@, C-x C-@, and M-C-x (`bash-4.2 -o emacs`) `#D1920` 342826f3 (master: a410b038) +- keymap/vi (`operator:filter`): do not append newline at the end of line `#D1994` 2a8e746f (master: bce20339) +- keymap/vi (`expand-range-for-linewise-operator`): fix the end point being not extended `#D1994` 2a8e746f (master: bce20339) +- syntax: fix unrecognized asignment `echo arr[i]+=rhs` [sabbrev: apply sabbrev to right-hand sides of variable assignments] `#D2006` 4ed4fd4f (master: 41faa494) +- syntax: fix unrecognized variable assignment of the form `echo arr[i]+=rhs` `#D2007` 4ed4fd4f (master: 41faa494) + +## Changes +- syntax: exclude \\ + LF at the word beginning from words (motivated by cmplstofB) `#D1431` 6044a485 (master: 67e62d64) +- edit: change default behavior of C-w and M-w to operate on backward words `#D1448` 787ff57f (master: 47a3301a) +- edit: the widgets `{kill,copy,delete}-region-or` now receives widgets as arguments `#D1021` 8f48aff1 (master: bbbd155f) +- edit (`ble/builtin/read`): cancel by C-d on an empty line `#D1473` 551bde3a (master: ecb8888d) +- syntax: change syntax context after `time ;` and `! ;` for Bash 4.4 `#D1477` 0b66cf4a (master: 46283706) +- prompt: invalidate prompt and textarea on prompt setting changes `#D1492` 54d310df (master: 1f559135) +- prompt: adjust behavior of `LINENO` and prompt sequence `\#` (reported by tycho-kirchner) `#D1542` 4b63b164 (master: 8b0257e2) +- main: show notifications against debug versions of Bash `#D1612` 608ac2ad (master: 8f974aa1) +- prompt: do not evaluate `PROMPT_COMMAND` for subprompts `#D1654` 5c0cfdef (master: 08e903e0) +- main: suppress non-interactive warnings from manually sourced startup files (reported by andreclerigo) `#D1676` 2587bb01 (master: 05255282) 88e2df5 +- main: suppress non-interactive warnings from manually sourced startup files (reported by andreclerigo) `#D1676` 0525528 5f638563 (master: 88e2df51) +- util (`ble/util/buffer`): hide cursor in rendering `#D1758` 4ecbbdc2 (master: e332dc5f) +- edit (`ble-detach`): prepend a space to `stty sane` for `HISTIGNORE=' *'` `#D1796` bd903716 (master: 26b532e7) +- history: disable the history file when `HISTFILE` is empty `#D1836` d97ca100 (master: 9549e831) +- keymap/vi (`decompose-meta`): translate S-a to A `#D1988` eaf66c7c (master: 600e845e) +- term (`_ble_term_TERM`): detect konsole `#D1988` eaf66c7c (master: 600e845e) ed53858 +- complete (`source:argument`): fallback to rhs completion also for `name+=rhs` `#D2006` 4ed4fd4f (master: 41faa494) + +## Compatibility +- highlight: fix a problem that the attribute of the last character is applied till EOL `#D1393` 36f9d809 (master: 2ddb1ba2) `#D1395` ef09932 +- highlight: fix a problem that the attribute of the last character is applied till EOL `#D1393` 2ddb1ba `#D1395` 6bcb4053 (master: ef099326) +- global: work around empty `vi_imap` cache by `tmux-resurrect` `#D1562` d7130d55 (master: 560160b0) +- main: work around `set -B` and `set -k` `#D1628` 3c97ae84 (master: a8607692) +- cmap: add `st`-specific escape sequences for cursor keys `#D1633` bf46e344 (master: acfb8790) +- cmap: distinguish find/select from home/end for openSUSE `inputrc.keys` (reported by cornfeedhobo) `#D1648` ad675556 (master: c4d28f40) +- cmap: freeze the internal codes of find/select and kitty special keys `#D1674` f41b8004 (master: fdfe62a4) +- decode: work around the overwritten builtin `set` (reported by eadmaster) `#D1680` 93ae08d0 (master: a6b4e2ca) +- complete: work around the variable leaks by `virsh` completion from `libvirt` (reported by telometto) `#D1682` ee2ac075 (master: f985b9a4) +- stty: do not remove keydefs for C-u, C-v, C-w, and C-? (reported by laoshaw) `#D1683` c01487bf (master: 82f74f0a) +- main: work around `XDG_RUNTIME_DIR` of a different user by `su` (reported by zim0369) `#D1712` e5501a31 (master: 8d370486) +- main (`ble/util/readlink`): work around non-standard or missing `readlink` (motivated by peterzky) `#D1720` d785f5db (master: a41279ed) +- global: work around the arithmetic syntax error of `10#` in Bash-5.1 `#D1734` 2b55aa16 (master: 7545ea31) +- global: adjust implementations for Bash 5.2 `patsub_replacement` `#D1738` 359a3891 (master: 4590997a) +- main: check `/dev/tty` on startup (reported by andychu) `#D1749` 19fa0924 (master: 711c69f1) +- global: work around `shopt -s compat42` `#D1754` e7adfb34 (master: a75bb25a) +- global: identify bash-4.2 bug that internal quoting of `${v/%$empty/"$rep"}` remains `#D1753` e7adfb34 (master: a75bb25a) +- prompt: fix a bug of `ble/prompt/print` redundantly quoting `$` `#D1752` e7adfb34 (master: a75bb25a) +- global: work around `compat42` quoting of `"${v/pat/"$rep"}"` `#D1751` e7adfb34 (master: a75bb25a) +- util: add identification of Windows Terminal `wt` `#D1758` 4ecbbdc2 (master: e332dc5f) +- global: work around bash-3.0 bug that single quotes remains for `"${v-$''}"` `#D1774` fb607ad6 (master: 9b96578c) +- main: resolve empty `HOSTNAME` [add `histdb`] `#D1925` 5812f2ef (master: 44d9e104) +- main: warn empty `LANG` [main: support an option `--inputrc={diff,all,user,none}`] `#D1926` 3f29bee3 (master: 92f20063) +- main: never load `/etc/inputrc` in openSUSE (motivated by Ultra980) `#D1926` 3f29bee3 (master: 92f20063) 0ceb0cb +- main: show warning for empty locale (movivated by Ultra980) `#D1927` 3f29bee3 (master: 92f20063) +- term (`terminology`): work around terminal glitches `#D1946` 2d4caa67 (master: 9a1b4f9f) +- edit: always adjust the terminal states with `bind -x` (reported by linwaytin) `#D1983` cdda7c44 (master: 5d14cf17) +- syntax: suppress brace expansions in designated array initialization in Bash 5.3 `#D1989` 78dd47ee (master: 1e7b884d) +- edit: restore `PS1` while processing `bind -x` (reported by adoyle-h) `#D2024` c46f4230 (master: 2eadcd5b) + +## Optimization +- util (`ble/util/assign`): work around subshell conflicts `#D1578` 59d6355c (master: 6e4bb126) +- prompt: fix not properly set `$?` in `${PS1@P}` evaluation (reported by nihilismus) `#D1644` 66fd10b7 (master: 521aff9b) +- util (`ble/string#split`): optimize `#D1826` 5b3fc89c (master: 7bb10a79) +- debug: add `ble/debug/profiler` (motivated by SuperSandro2000) `#D1824` f629698 11aa4ab 5b3fc89c (master: 7bb10a79) +- global: avoid passing arbitrary strings through `awk -v var=value` `#D1827` 4571695a (master: 82232de5) + +## Internal changes and fixes +- main: include hostname in local runtime directory `#D1444` d19ab298 (master: 64948361) +- global: fix status check for read timeout `#D1467` 0bcc12c9 (master: e886883b) +- util, etc: ensure each function to work with arbitrary `IFS` `#D1490` `#D1491` 2fe60b64 (master: 5f9adfe8) +- util: fix `ble/util/dense-array#fill-range` b708ee29 (master: a46fdaf4) +- util: fix leak variables `buff`, `trap`, `{x,y}{1,2}` `#D1572` 36d151e2 (master: 5967d6ce) +- make: add fallback Makefile for BSD make `#D1805` 6498a5d3 (master: e5d8d00c) +- util, decode, vi: fix leak variables `#D1933` 002dda7f (master: 8d5cab85) +- syntax: fix code formatting [histdb: support auto-complete source `histdb-word`] `#D1938` edd48d1c (master: 00cae745) +- main: use builtin for `:` [histdb: support timeout of background processes] `#D1971` 8640dc41 (master: e0566bdc) +- global: normalize bracket expressions to `_a-zA-Z` / `_a-zA-Z0-9` `#D2006` 4ed4fd4f (master: 41faa494) +- util (restore-vars): work around `set -u` [util.bgproc: separate `ble/util/bgproc` from `histdb`] `#D2017` d60758ae (master: 7803305f) + +## Test +- util (ble/util/s2bytes): clear locale cache `#D1881` 99e217d3 (master: 2e1a7c17) +- util (ble/util/s2c): work around intermediate mbstate of bash <= 5.2 `#D1881` 99e217d3 (master: 2e1a7c17) +- util (ble/encoding:UTF-8/b2c): fix interpretation of leading byte `#D1881` 99e217d3 (master: 2e1a7c17) + +## New features +- syntax: support context after `((...))` and `[[ ... ]]` in bash-5.2 `#D1962` 74af9e60 (master: 67cb967a) + +-------------------------------------------------------------------------------- +# ble-0.1.15 + +## Usage + +**Prerequisites** + +Bash 3.0+ and basic POSIX utilities are required. + +**Download ble-0.1.15.tar.xz** + +https://github.com/akinomyoga/ble.sh/releases/download/v0.1.15/ble-0.1.15.tar.xz + +```bash +# DOWNLOAD with wget +wget https://github.com/akinomyoga/ble.sh/releases/download/v0.1.15/ble-0.1.15.tar.xz + +# DOWNLOAD with curl +curl -LO https://github.com/akinomyoga/ble.sh/releases/download/v0.1.15/ble-0.1.15.tar.xz +``` + +**Trial & Install** + +```bash +# TRIAL +tar xJf ble-0.1.15.tar.xz +source ble-0.1.15/ble.sh + +# INSTALL +tar xJf ble-0.1.15.tar.xz -C ~/.local/share/blesh +# Add the following line near the top of ~/.bashrc +[[ $- == *i* ]] && source ~/.local/share/blesh/ble.sh --noattach +# Add the following line at the end of ~/.bashrc +((_ble_bash)) && ble-attach +``` + +## blesh-0.1 fixes +- edit,highlight: backport changes in rebased commits dfac242 +- bump 0.1.15 3f4d866 + +## Fixes +- edit (sword): fix definition of `sword` (shell words) `#D1441` 03980f1 (master: f923388) +- bind: work around broken `cmd_xmap` after switching the editing mode `#D1478` 847e602 (master: 8d354c1) +- benchmark (`ble-measure`): fix a bug that the result is always 0 in Bash 3 and 4 (fixup 4759768 (master: bbc2a90)) `#D1615` a034c91 +- main: work around `. ble.sh --{test,update,clear-cache}` in intereactive sessions `#D1555` 4759768 (master: bbc2a90) +- main: fix reloading after ble-update (fixup 4759768 (master: bbc2a90)) (fixed by oc1024) `#D1558` 9372670 +- main: fix exit status for `bash ble.sh --test` (fixup 4759768 (master: bbc2a90)) `#D1558` 641238a +- main: work around sourcing `ble.sh` inside subshells `#D1554` 4759768 (master: bbc2a90) +- util: work around the Bash 3 bug of array assignments with `^A` and `^?` in Bash 3.2 `#D1614` 9648bd4 (master: b9f7611) +- decode, canvas, etc.: explicitly treat CSI arguments as decimal numbers (reported by GorrillaRibs) `#D1625` 40a0ec9 (master: c6473b7) 2ea48d7 +- edit: fix a bug that `command-help` doesn't work `#D1635` c99e2f1 (master: 0f6a083) +- canvas: update prompt trace on `char_width_mode` change (reported by Barbarossa93) `#D1642` 5b22cd6 (master: 68ee111) +- complete: do not generate keywords for quoted command names `#D1691` cd75f39 (master: 60d244f) +- progcomp: retry completions on `$? == 124` also for non-default completions (reported by SuperSandro2000) `#D1759` a66b547 (master: 82b9c01) +- edit: fix the restore failure of `PS1` and `PROMPT_COMMAND` on `ble-detach` `#D1784` a0f6594 (master: b9fdaab) +- history: work around possible dirty prefix `*` in the history output `#D1808` 0ed2ffb (master: 64a740d) +- main. util: fix problems of readlink etc. found by test in macOS (reported by aiotter) `#D1849` 1dc5938 (master: fa955c1) `#D1855` a22e145 +- global: quote `return $?` `#D1884` c2ba90b (master: 801d14a) +- bind: fix M-C-@, C-x C-@, and M-C-x (`bash-4.2 -o emacs`) `#D1920` de577dc (master: a410b03) + +## Changes +- syntax: exclude \\ + LF at the word beginning from words (motivated by cmplstofB) `#D1431` 69156f1 (master: 67e62d6) +- edit: change default behavior of C-w and M-w to operate on backward words `#D1448` 0a07c13 (master: 47a3301) +- edit: the widgets `{kill,copy,delete}-region-or` now receives widgets as arguments `#D1021` ec16708 (master: bbbd155) +- main: show notifications against debug versions of Bash `#D1612` 8f989e4 (master: 8f974aa) +- main: suppress non-interactive warnings from manually sourced startup files (reported by andreclerigo) `#D1676` 2a045d8 (master: 0525528) 88e2df5 +- main: suppress non-interactive warnings from manually sourced startup files (reported by andreclerigo) `#D1676` 0525528 4ef844e (master: 88e2df5) +- util (`ble/util/buffer`): hide cursor in rendering `#D1758` 444abff (master: e332dc5) +- edit (`ble-detach`): prepend a space to `stty sane` for `HISTIGNORE=' *'` `#D1796` acb7c08 (master: 26b532e) +- history: disable the history file when `HISTFILE` is empty `#D1836` a79095a (master: 9549e83) + +## Compatibility +- global: work around empty `vi_imap` cache by `tmux-resurrect` `#D1562` b0cc0a3 (master: 560160b) +- cmap: add `st`-specific escape sequences for cursor keys `#D1633` ae298f1 (master: acfb879) +- cmap: distinguish find/select from home/end for openSUSE `inputrc.keys` (reported by cornfeedhobo) `#D1648` 603cf41 (master: c4d28f4) +- cmap: freeze the internal codes of find/select and kitty special keys `#D1674` 66263c4 (master: fdfe62a) +- decode: work around the overwritten builtin `set` (reported by eadmaster) `#D1680` 43dcb66 (master: a6b4e2c) +- complete: work around the variable leaks by `virsh` completion from `libvirt` (reported by telometto) `#D1682` d13ce5b (master: f985b9a) +- stty: do not remove keydefs for C-u, C-v, C-w, and C-? (reported by laoshaw) `#D1683` 6335dc2 (master: 82f74f0) +- main (`ble/util/readlink`): work around non-standard or missing `readlink` (motivated by peterzky) `#D1720` 94137b7 (master: a41279e) +- global: work around the arithmetic syntax error of `10#` in Bash-5.1 `#D1734` 7c2463e (master: 7545ea3) +- global: adjust implementations for Bash 5.2 `patsub_replacement` `#D1738` f1599ee (master: 4590997) +- main: check `/dev/tty` on startup (reported by andychu) `#D1749` 28e9c44 (master: 711c69f) +- global: work around `shopt -s compat42` `#D1754` 59075cc (master: a75bb25) +- global: identify bash-4.2 bug that internal quoting of `${v/%$empty/"$rep"}` remains `#D1753` 59075cc (master: a75bb25) +- prompt: fix a bug of `ble/prompt/print` redundantly quoting `$` `#D1752` 59075cc (master: a75bb25) +- global: work around `compat42` quoting of `"${v/pat/"$rep"}"` `#D1751` 59075cc (master: a75bb25) +- util: add identification of Windows Terminal `wt` `#D1758` 444abff (master: e332dc5) +- global: work around bash-3.0 bug that single quotes remains for `"${v-$''}"` `#D1774` d0dc13e (master: 9b96578) +- highlight: fix a problem that the attribute of the last character is applied till EOL `#D1393` 2ddb1ba `#D1395` 8c33557 (master: ef09932) +- main: resolve empty `HOSTNAME` [add `histdb`] `#D1925` e6cc6c3 (master: 44d9e10) +- main: warn empty `LANG` [main: support an option `--inputrc={diff,all,user,none}`] `#D1926` 2bd1544 (master: 92f2006) +- term (`terminology`): work around terminal glitches `#D1946` c5c3bc9 (master: 9a1b4f9) +- edit: restore `PS1` while processing `bind -x` (reported by adoyle-h) `#D2024` 94db09b (master: 2eadcd5) + +## Optimization +- prompt: fix not properly set `$?` in `${PS1@P}` evaluation (reported by nihilismus) `#D1644` a7b5c4b (master: 521aff9) + +## Internal changes and fixes +- main: include hostname in local runtime directory `#D1444` 1a5e90a (master: 6494836) +- global: fix status check for read timeout `#D1467` b56d638 (master: e886883) +- util, etc: ensure each function to work with arbitrary `IFS` `#D1490` `#D1491` 7228fd0 (master: 5f9adfe) +- util: fix leak variables `buff`, `trap`, `{x,y}{1,2}` `#D1572` de71ada (master: 5967d6c) +- make: add fallback Makefile for BSD make `#D1805` 2cb758f (master: e5d8d00) +- util, decode, vi: fix leak variables `#D1933` a2197a6 (master: 8d5cab8) +- syntax: fix code formatting [histdb: support auto-complete source `histdb-word`] `#D1938` 492349f (master: 00cae74) + +## Test +- util (ble/util/s2bytes): clear locale cache `#D1881` a8d7fd7 (master: 2e1a7c1) +- util (ble/util/s2c): work around intermediate mbstate of bash <= 5.2 `#D1881` a8d7fd7 (master: 2e1a7c1) +- util (ble/encoding:UTF-8/b2c): fix interpretation of leading byte `#D1881` a8d7fd7 (master: 2e1a7c1) + +-------------------------------------------------------------------------------- # ble-0.4.0-devel2 ## Usage diff --git a/keymap/vi.sh b/keymap/vi.sh index 87c8eab8..0ae55cdd 100644 --- a/keymap/vi.sh +++ b/keymap/vi.sh @@ -102,7 +102,7 @@ function ble/keymap:vi/string#encode-rot13 { #------------------------------------------------------------------------------ # constants -_ble_keymap_vi_REX_WORD=$'[a-zA-Z0-9_]+|[!-/:-@[-`{-~]+|[^ \t\na-zA-Z0-9!-/:-@[-`{-~]+' +_ble_keymap_vi_REX_WORD=$'[_a-zA-Z0-9]+|[!-/:-@[-`{-~]+|[^ \t\na-zA-Z0-9!-/:-@[-`{-~]+' #------------------------------------------------------------------------------ # vi_imap/__default__, vi-command/decompose-meta diff --git a/keymap/vi_test.sh b/keymap/vi_test.sh index 311a94d3..94b48b9f 100644 --- a/keymap/vi_test.sh +++ b/keymap/vi_test.sh @@ -4,10 +4,10 @@ function ble/keymap:vi_test/decompose-state { local spec=$1 ind=${spec%%:*} str=${spec#*:} - if ((${#ind}==1)) && [[ $ind == [!0-9a-zA-Z] ]]; then + if ((${#ind}==1)) && [[ $ind == [!a-zA-Z0-9] ]]; then ind=${str%%"$ind"*} ind=${#ind} str=${str::ind}${str:ind+1} mark= - elif ((${#ind}==2)) && [[ ${ind::1} == [!0-9a-zA-Z] && ${ind:1:1} == [!0-9a-zA-Z] ]]; then + elif ((${#ind}==2)) && [[ ${ind::1} == [!a-zA-Z0-9] && ${ind:1:1} == [!a-zA-Z0-9] ]]; then local ind1=${ind::1} ind2=${ind:1:1} text text=${str//"$ind2"} text=${text%%"$ind1"*} ind=${#text} text=${str//"$ind1"} text=${text%%"$ind2"*} mark=${#text} diff --git a/lib/core-syntax.sh b/lib/core-syntax.sh index 22f35920..03720855 100644 --- a/lib/core-syntax.sh +++ b/lib/core-syntax.sh @@ -1868,7 +1868,7 @@ function ble/syntax/highlight/vartype/.impl { local __ble_name=$1 __ble_opts=$2 __ble_tail=$3 local __ble_attr; ble/variable#get-attr -v __ble_attr "$__ble_name" if [[ ${!__ble_name+set} || $__ble_attr == *[aA]* ]]; then - local __ble_rex='^-?[0-9]+(#[0-9a-zA-Z@_]*)?$' + local __ble_rex='^-?[0-9]+(#[_a-zA-Z0-9@]*)?$' if [[ ${!__ble_name-} && :$__ble_opts: == *:expr:* && ! ( ${!__ble_name} =~ $__ble_rex ) ]]; then __ble_vartype_ret=$ATTR_VAR_EXPR elif [[ ${!__ble_name+set} && $__ble_attr == *x* ]]; then @@ -2889,7 +2889,7 @@ function ble/syntax:bash/ctx-expr { local ret; ble/syntax/highlight/vartype "$BASH_REMATCH" readvar:expr:global ((_ble_syntax_attr[i]=ret,i+=${#rematch})) return 0 - elif rex='^0[xX][0-9a-fA-F]*|^[0-9]+(#[0-9a-zA-Z@_]*)?'; [[ $tail =~ $rex ]]; then + elif rex='^0[xX][0-9a-fA-F]*|^[0-9]+(#[_a-zA-Z0-9@]*)?'; [[ $tail =~ $rex ]]; then ((_ble_syntax_attr[i]=ATTR_VAR_NUMBER,i+=${#BASH_REMATCH})) return 0 elif ble/syntax:bash/check-plain-with-escape "[^${_ble_syntax_bash_chars[ctx]}_a-zA-Z0-9]+" 1; then @@ -2944,7 +2944,7 @@ function ble/syntax:bash/ctx-expr { function ble/syntax:bash/check-brace-expansion { [[ $tail == '{'* ]] || return 1 - local rex='^\{[-+0-9a-zA-Z.]*(\}?)' + local rex='^\{[-+a-zA-Z0-9.]*(\}?)' [[ $tail =~ $rex ]] local str=$BASH_REMATCH @@ -3454,7 +3454,7 @@ function ble/syntax:bash/ctx-coproc/check-word-end { local word=${text:wbegin:wlen} local wt=$wtype - if local rex='^[_a-zA-Z][_a-zA-Z]*$'; [[ $word =~ $rex ]]; then + if local rex='^[_a-zA-Z][_a-zA-Z0-9]*$'; [[ $word =~ $rex ]]; then if ble/syntax:bash/ctx-coproc/.is-next-compound; then # 構文: 変数名 複合コマンド local attr=$ATTR_VAR @@ -5662,7 +5662,7 @@ function ble/syntax/completion-context/.check-prefix/ctx:rhs { ble/syntax/completion-context/.check/parameter-expansion if ((wlen>=0)); then local p=$wbeg - local rex='^[a-zA-Z0-9_]+(\+?=|\[)' + local rex='^[_a-zA-Z0-9]+(\+?=|\[)' ((ctx==CTX_VALR)) && rex='^(\[)' if [[ ${text:p:index-p} =~ $rex ]]; then if [[ ${BASH_REMATCH[1]} == '[' ]]; then diff --git a/make_command.sh b/make_command.sh index 17bd2d51..14784852 100755 --- a/make_command.sh +++ b/make_command.sh @@ -1244,8 +1244,8 @@ function sub:scan/bash502-patsub_replacement { \Z/\$\(\([^()]+\)\)\}Zd \Z/\$'\''([^\\]|\\.)+'\''\}Zd - \Z\$\{[a-zA-Z0-9_]+//(ARR|DICT|PREFIX|NAME)/\$([a-zA-Z0-9_]+|\{[a-zA-Z0-9_#:-]+\})\}Zd - \Z\$\{[a-zA-Z0-9_]+//'\''%[dlcxy]'\''/\$[a-zA-Z0-9_]+\}Zd # src/canvas.sh + \Z\$\{[_a-zA-Z0-9]+//(ARR|DICT|PREFIX|NAME)/\$([_a-zA-Z0-9]+|\{[_a-zA-Z0-9#:-]+\})\}Zd + \Z\$\{[_a-zA-Z0-9]+//'\''%[dlcxy]'\''/\$[_a-zA-Z0-9]+\}Zd # src/canvas.sh \Z#D1738Zd \Z\$\{_ble_edit_str//\$'\''\\n'\''/\$'\''\\n'\''"\$comment_begin"\}Zd # edit.sh @@ -1482,7 +1482,7 @@ function sub:scan { \Ztext = "eval -- \$'\''Zd \Zcmd '\''eval -- %q'\''Zd \Z\$\(eval \$\(call .*\)\)Zd - \Z^[[:space:]]*local rex_[a-zA-Z0-9_]+='\''[^'\'']*'\''[[:space:]]*$Zd + \Z^[[:space:]]*local rex_[_a-zA-Z0-9]+='\''[^'\'']*'\''[[:space:]]*$Zd \ZLINENO=\$_ble_edit_LINENO evalZd g' sub:scan/builtin 'unset' | @@ -1627,13 +1627,21 @@ function sub:release-note/.find-commit-pairs { } /^__MODE_MASTER__$/ { mode = "master"; next; } + function reduce_title(str) { + str = $2; + #if (match(str, /^.*\[(originally: )?(.+: .+)\]$/, m)) str = m[2]; + gsub(/["`]/, "", str); + #print str >"/dev/stderr"; + return str; + } + mode == "head" { i = nlist++; - titles[i] = $2 + titles[i] = $2; commit_head[i] = $1; - title2index[$2] = i; + title2index[reduce_title($2)] = i; } - mode == "master" && (i = title2index[$2]) != "" && commit_master[i] == "" { + mode == "master" && (i = title2index[reduce_title($2)]) != "" && commit_master[i] == "" { commit_master[i] = $1; } @@ -1658,26 +1666,69 @@ function sub:release-note { local commit_pair for commit_pair in "${commits[@]}"; do - local a=${commit_pair%%:*} - commit_pair=${commit_pair:${#a}+1} - local b=${commit_pair%%:*} - local c=${commit_pair#*:} + local hash=${commit_pair%%:*} + commit_pair=${commit_pair:${#hash}+1} + local hash_base=${commit_pair%%:*} + local title=${commit_pair#*:} + + local rex_hash_base=$hash_base + if ((${#hash_base} == 7)); then + rex_hash_base=$hash_base[0-9a-f]? + elif ((${#hash_base} == 8)); then + rex_hash_base=$hash_base? + fi local result= - [[ $b ]] && result=$(awk ' + [[ $hash_base ]] && result=$(awk ' sub(/^##+ +/, "") { heading = "[" $0 "] "; next; } - sub(/\y'"$b"'\y/, "'"$a (master: $b)"'") {print heading $0;} + sub(/\y'"$rex_hash_base"'\y/, "'"$hash (master: $hash_base)"'") {print heading $0;} ' "$fname_changelog") if [[ $result ]]; then echo "$result" - elif [[ $c ]]; then - echo "- $c $a (master: ${b:-N/A}) ■NOT-FOUND■" + elif [[ $title ]]; then + echo "- $title $hash (master: ${hash_base:-N/A}) ■NOT-FOUND■" else - echo "■not found $a" + echo "■not found $hash" fi done | tac } +# 以下の様な形式のファイルをセクション毎に分けて出力します。 +# +# [Fixes] - foo bar +# [New features] - foo bar +# [Fixes] - foo bar +# [Fixes] - foo bar +# ... +function sub:release-note-sort { + local file=$1 + awk ' + match($0, /\[[^][]+\]/) { + key = substr($0, 1, RLENGTH); + gsub(/^\[|]$/, "", key); + + line = substr($0, RLENGTH + 1); + gsub(/^[[:space:]]+|[[:space:]]+$/, "", line); + if (line == "") next; + if (line !~ /^- /) line = "- " line; + + if (sect[key] == "") + keys[nkey++] = key; + sect[key] = sect[key] line "\n" + next; + } + {print} + + END { + for (i=0;i done.txt - - version up in GNUmakefile, README + - version up in README - Copyright year - Acknowledgments - todo 項目の整理 - leakvars + - version up in GNUmakefile + - note.txt に含まれるログの移動 -> done.txt - keymap の移動 (これは別 commit にする?) - make_command.sh の整理 (scan 分離, char_width 分離) +2023-04-02 + + * set -o posix で起動すると keymap が見つからないというエラーが発生する + + * history (bash 3.0): 履歴が重複して記録される + + bash-3.1 以降では問題ない様だ。つまり bash-3.0 だけで起きている問題である。 + これの優先度は低い。或いはもしかすると既知の問題である可能性? + + * prompt: 右プロンプトの範囲に合わせて textarea の横幅を途中で切り替える? + https://github.com/akinomyoga/ble.sh/discussions/310 + + これはこれまでにも考えた事があるはずだと思ったが todo 項目が見つからない。 + もしかすると頭の中で思っていただけかもしれない。 + + * scroll 機能との兼ね合い → rps1 も一緒に scroll する事にすれば良い。 + + 少し考えてみたがどうも scroll 機能と conflict する気がする。scroll する毎 + に各行の折返を実行し直すというのは well-defined なのか。というかそもそも + 他のアプリケーションでもその様な変な形の枠の中で scroll しながら枠に合わ + せて折返を実行し直すという実装は見た事がない。 + + 或いは、scroll する場合にはそれに応じて rps も一緒に scroll するという可 + 能性? その様にすれば変な事は気にしなくて良い。rps1 を途中で切断しなければ + ならないかもしれないがそれに関しては clip すれば良い気がする。 + + 然し長いコマンドラインを実行した後に rps1 が表示されない状態で次のプロン + プトに行くという事にならないか。或いは長いコマンドラインの時には全体を一 + 旦出力して次に進むという事にすれば良いのだろうか。新しいコマンドラインに + 移動する直前であればターミナルを溢れてしまっても問題ない筈なので。下手に + 削られて記録が消えるよりはそちらの方が自然の気がする。 + + と思ったがスクロール範囲はプロンプトの最終行から始まる。なので、右プロン + プトもプロンプトの最終行以降に被っている部分だけスクロールする事になるの + だろうか。何だか複雑である。然し、そもそも右プロンプトもプロンプトの高さ + で範囲を制限していて非自明な事をしているのでその程度の事は寧ろ自然の気も + する。 + +2023-03-27 + + * menu-complete: 長い候補を表示した後の再配置 + Ref #D2025 + + これは WINCH 後の振る舞いにも関係している。WINCH があったら menu を閉じるか + 或いは再配置を行う必要がある。現在は開きっぱなしになっている気がする。或い + は…何か変な状態になっている。info panel の高さはクリアされているけれども描 + 画されていない状態? の気がする。 + + 本当は info に関係する winch の callback も欲しいという事。或いは panel + height 決定で要求したのと異なる高さになった時に呼び出す hook? というか単に + panel height change に対する hook で良い気がする。そして既にその仕組は + onHeightChange で実装されている。現状では info#panel::onHeightChange は実装 + されていない。此処で info#panel::onHeightChange に際して現在の選択項目が範 + 囲外になっていたら再描画を発生させる hook を登録できる様にする。現在表示し + ている内容が menu なのかどうかの情報を何処に記録するのかはよく分からない。 + + どうも winch を実行すると瞬間的に高さが縮む様である。その後で続きを処理しよ + うとすると高さがまた元の高さに戻る。うーん。と思ったがそうでも無いような気 + がする。前回と同じ高さであっても onHeightChange が呼び出されている。何故だ + ろうか。内容がクリアされてなくなってしまった場合にも呼び出されるという事と + 思って良いか。 + + →うーん。どうやら潰れて見えなくなった時には onHeightChange は呼び出されな + い様だ。その後で最初に有限の高さに戻った時に onHeightChange が呼び出される。 + + 然し height change を受け取ったとしてもその場で再描画する訳には行かない。既 + に描画の途中でその処理の途中に height change が起こっているかもしれないから + である。 + + a うーん。onHeightChange に於いて invalidate を設定する? でもこれだと現状で + 潰れた時に onHeightChange を呼び出していないので、潰れた事を検知できない。 + + b もしくは info#panell::render に於いて高さを毎回チェックすれば良いのかもし + れない。と思ったが、これも潰れた時に一度も呼び出されないので潰れてまた拡 + 大した時に検知できないのではないか。 + + 取り敢えず menu-complete 中に長い行が選択されて info が縮まった後にもちゃん + と onHeightChange は呼び出される様だ。但し、onHeightChange が呼び出された後 + に果たして render が呼び出されるのかは保証できない。上の枠組みで高さが変化 + したら render を改めて呼び出すという事を処理する様にしてしまうと今度は無限 + ループになるのではないかという懸念が生じる。 + + 現状の canvas panel の枠組みにおける問題点は以下の二つである。 + + * onHeightChange が潰れた時に呼び出されない。潰れた時にも呼び出す様に変更し + たいが、既存の onHeightChange の処理がどうなっているか気になる。 + + 更に潰れたという事が command-layout 等の都合で一時的に潰れる (後で全体を + 再描画する予定) という事なのか、それとも他の panel が大きくて潰れざるを得 + なかった (後で再描画はしない。より小さい領域に fit する様に処理する必要が + ある可能性はある) という事なのかで振る舞いが違っても良い。 + + 一時的に潰れているだけなのであれば現状の様に onHeightChange は呼び出さず + に別の種類の処理を呼び出すべきの気がする。 + + * 一つの描画処理の中で既に描画し終わった panel の size change が発生した時 + に、その panel を改めて再描画する様に処理するか? + + 然しそもそも描画処理の途中に高さが変わるという事があるのかというのは疑問 + である。調べてみるとどの panel も途中で reallocate-height.draw を呼び出し + ている。そもそもこの段階で処理を再考するべきなのではないか? + + 最初の処理の段階で希望の高さを提出しておいて reallocate-height を実行した + 後に各 panel の描画を開始する。各 panel は与えられた高さの中で表示する様 + にする。もし足りない場合には fallback するか collapse する (減る分には問 + 題はない筈)。 + + * invalidate は panel 側でも管理するべき? 但し、分からない。 + +2023-03-24 + + * histdb: sqlite3 がクラッシュしていた。或いは timeout した物の情報が同期され + ていなかった可能性? timeout をより短くして再現するかどうか確認する必要があ + る。 + 2023-03-09 * sabbrev: suffix alias in Zsh (拡張子で実行形式を選択) diff --git a/src/color.sh b/src/color.sh index 453c0567..f0b8b796 100644 --- a/src/color.sh +++ b/src/color.sh @@ -1007,7 +1007,7 @@ fi ## @fn ble/color/setface/.check-argument ## @var[out] ext function ble/color/setface/.check-argument { - local rex='^[a-zA-Z0-9_]+$' + local rex='^[_a-zA-Z0-9]+$' [[ $# == 2 && $1 =~ $rex && $2 ]] && return 0 local flags=a diff --git a/src/edit.sh b/src/edit.sh index d260a2fb..56de8e21 100644 --- a/src/edit.sh +++ b/src/edit.sh @@ -2993,6 +2993,7 @@ function ble/textarea#invalidate { ## @fn ble/textarea#render/.erase-forward-line.draw opts ## @var[in] x cols +## @var[out] DRAW_BUFF function ble/textarea#render/.erase-forward-line.draw { local eraser=$_ble_term_sgr0$_ble_term_el if [[ :$render_opts: == *:relative:* ]]; then