Skip to content

Commit

Permalink
edit: suppress only "stderr" with "internal_suppress_bash_output"
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Sep 17, 2021
1 parent 9a132b7 commit a30887f
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 8 deletions.
5 changes: 3 additions & 2 deletions memo/ChangeLog.md
Expand Up @@ -58,7 +58,8 @@
- syntax: recognize escape \" in double-quoted strings `#D1641` 4b71449
- prompt: support a new backslash sequence `\g{...}` `#D1609` be31391
- complete: add a new option `bleopt complete_limit_auto_menu` `#D1618` 1829d80
- canvas: support grapheme clusters (motivated by huresche) `#D1619` 0000000
- canvas: support grapheme clusters (motivated by huresche) `#D1619` c0d997b
- canvas (`ble/util/c2w`): use `EastAsianWidth` and `GeneralCategory` to mimic `wcwidth` `#D1645` 9a132b7
- rlfunc: support vi word operations in `emacs` keymap (requested by SolarAquarion) `#D1624` 21d636a
- edit: support `TMOUT` for the session timeout `#D1631` 0e16dbd
- edit: support bash-5.2 `READLINE_ARGUMENT` `#D1638` d347fb3
Expand Down Expand Up @@ -95,7 +96,7 @@
- keymap/vi: update mode names on change of `bleopt keymap_vi_mode_name_*` (motivated by huresche) `#D1565` 11ac106
- main: show notifications against debug versions of Bash `#D1612` 8f974aa
- term: update `vte` identification `#D1620` 00e74d8
- canvas (`ble/util/c2w`): use `EastAsianWidth` and `GeneralCategory` to mimic `wcwidth` `#D1645` 0000000
- edit: suppress only `stderr` with `internal_suppress_bash_output` (motivated by rashil2000) `#D1646` 0000000

## Fixes

Expand Down
61 changes: 61 additions & 0 deletions note.txt
Expand Up @@ -1582,6 +1582,49 @@ bash_tips

2021-09-15

* haiku: ble/builtin/bind/.reconstruct-user-settings の gawk が無限ループになっ
ている? 或いは滅茶苦茶遅くなっている。gawk 4.2 である。bash-4.4.23 から呼び
出している。変な事が起こる様な余地はない様な気がするが…或いは正規表現エン
ジンなどが壊れているという事なのかもしれない。

* solaris: ble-bind を bashrc 内部で呼び出した時点で未だ attach していないの
に色々と info を表示してしまっている。
$_ble_base_cache/decode.cmap.gdict.*.dump を削除した時に再現する。

* ディレクトリ構造の整理

* make ディレクトリに Unicode 関係のテーブルの生成コードを移動する?

現在は memo/ 以下にファイルを持っているが何だか違う気がする。他に leakvar
の whitelist のファイルなども make 以下に移動した方が良い様な気がする。
memo/ChangeLog.md や memo/Relases.md に関してはまた docs/ 等の下にある方
が分かりやすい筈である。

* docs ディレクトリに雑多のファイルを移動する?

x GitHub のシンボリックリンクの問題

色々のファイルを docs ディレクトリに押し込めようと思ったが、git clone
した時に分かりにくいので LICENSE と README に関してはせめて symbolic
link を置こうと思ったが…GitHubのインターフェイスだと symbolic link を
開いても中身の文字列が表示されるだけで、その指し示している先にジャンプ
する事ができない。これはかなり不便である。検索したが余りそういう要望は
ない様である。以下に何やら要望があるが、そもそもこの repository を
GitHub が見ているのかどうかも謎である。

https://github.com/dear-github/dear-github/issues/156

* keymap の下にある物も何処かのタイミングで lib/* に移動したい。0.5 に変更
する時に移動しようとも思っていたが、0.4 がいつ完成するか分からないし、コー
ドの移動を一度に実行すると code frequency にまた大きな spike が立ってしま
うので、release 等とは関係なく思い立った時に実行した方が良いのかもしれな
いとも思う。

何れにしても既存の物についてのディレクトリ構造の変更は、他の変更が pending
になっていない綺麗な状態で実行するべきである気がする。現在は Unicode 関係の
テーブル生成についても、中途半端である。少なくとも c2w 関連の実装が一区切り
してから考えるべきことである様に思われる。

* grapheme: SpacingMark, Prepend の幅は一体どうなっているのだろうか [#T0007]

現在の実装では幅を全く考慮に入れていないが、入れるべきの気がする。c2w で
Expand Down Expand Up @@ -5329,6 +5372,24 @@ bash_tips
Done (実装ログ)
-------------------------------------------------------------------------------

2021-09-16

* edit: stdout.off で stderr だけ suppress という案について (motivated by rashil2000) [#D1646]
https://github.com/akinomyoga/ble.sh/issues/133#issuecomment-910543950

試してみたら普通に動く様である。つまり bash は stderr にしか物を出力しない。
他の環境でも同様に動くか確かめてから適用する事にする。

* Cygwin: OK
* Void Linux: OK
* Ubuntu: OK
* Solaris: OK
* Haiku: OK
* Minux: OK
* BSD: OK

うーん。置き換えてしまって問題ない気がする。

2021-09-15

* canvas: c2w の再設計 [#D1645]
Expand Down
10 changes: 4 additions & 6 deletions src/edit.sh
Expand Up @@ -8443,20 +8443,18 @@ function ble-edit/bind/stdout.off { ble/util/buffer.flush >&2;}
function ble-edit/bind/stdout.finalize { :;}

if [[ $bleopt_internal_suppress_bash_output ]]; then
_ble_edit_io_fname1=$_ble_base_run/$$.stdout
_ble_edit_io_fname2=$_ble_base_run/$$.stderr

function ble-edit/bind/stdout.on {
exec 1>&$_ble_util_fd_stdout 2>&$_ble_util_fd_stderr
exec 2>&$_ble_util_fd_stderr
}
function ble-edit/bind/stdout.off {
ble/util/buffer.flush >&2
ble-edit/io/check-stderr
exec 1>>$_ble_edit_io_fname1 2>>$_ble_edit_io_fname2
exec 2>>$_ble_edit_io_fname2
}
function ble-edit/bind/stdout.finalize {
ble-edit/bind/stdout.on
[[ -f $_ble_edit_io_fname1 ]] && : >| "$_ble_edit_io_fname1"
[[ -f $_ble_edit_io_fname2 ]] && : >| "$_ble_edit_io_fname2"
}

Expand Down Expand Up @@ -8557,7 +8555,7 @@ if [[ $bleopt_internal_suppress_bash_output ]]; then
function ble-edit/bind/stdout.off {
ble/util/buffer.flush >&2
ble-edit/io/check-stderr
exec 1>>$_ble_edit_io_fname1 2>&$_ble_edit_io_fd2
exec 2>&$_ble_edit_io_fd2
}
elif . "$_ble_base/lib/init-msys1.sh"; ble-edit/io:msys1/start-background; then
function ble-edit/bind/stdout.off {
Expand All @@ -8568,7 +8566,7 @@ if [[ $bleopt_internal_suppress_bash_output ]]; then
# メッセージを抑制するには先に >/dev/null してから別の exec で繋がな
# ければならない。同じ exec でリダイレクトしようとするとメッセージ本
# 体は表示されないが、エラーメッセージの改行だけは出力されてしなう。
exec 1>>$_ble_edit_io_fname1 2>/dev/null
exec 2>/dev/null
exec 2>>$_ble_edit_io_fname2.buff
}
fi
Expand Down

0 comments on commit a30887f

Please sign in to comment.