Skip to content

Commit

Permalink
edit: fix fd broken by ble-attach of new session (fixup 49f9761)
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Aug 29, 2024
1 parent 4f0e94a commit 670c7ea
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
- util(`ble/function#evaldef`): suppress alias expansions (reported by 103sbavert) `#D2240` 51e762fe
- main: fix a bug that `_ble_bash` is missing (reported by tessus and Knusper) `#D2242` bb2dae6e a9b962d2
- mandb: fix incorrect use of `groff` in place of `nroff` `#D2245` e0ffc418
- edit: fix fd broken by ble-attach of new session in user space (reported by JohEngstrom) `#D2271` 49f97618
- edit: fix fd broken by ble-attach of new session in user space (reported by JohEngstrom) `#D2271` 49f97618 xxxxxxxx
- util (`ble-import`): do not specify arguments to `-C callback` `#D2277` xxxxxxxx

## Compatibility
Expand Down
6 changes: 6 additions & 0 deletions note.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7483,6 +7483,12 @@ bash_tips
て、_ble_edit_exec_gexec__save_lastarg の呼び出し限定の物なので、4, 5 に
実際に user space で設定した fd が含まれている。

2024-08-29 直したと思ったが改めて見てみたら直っていない。というか条件が反転
している。後 EOF 云々というメッセージがまだ出ている。疑問は途中で session
を reload した時に EXIT, ERR などの一連の処理を実行するべきかどうかという事
である。うーん。汚いが失敗した時は ble-import 決め打ちという事にして後の処
理をキャンセルするべきか。

* [OK] util(bleopt): BASH_REMATCH が上書きされている。 [#D2270]

ble.sh --norc では再現しない。上書きされている時の値を見ると
Expand Down
7 changes: 5 additions & 2 deletions src/edit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6443,7 +6443,7 @@ function ble/widget/zap-to-char.hook {
ble/widget/self-insert/.get-code
ble/util/c2s "$code"
char=$ret

# search nth occurrence of `char` and send it to the kill ring
local arg; ble-edit/content/get-arg 1
if ((arg>=0)); then
Expand Down Expand Up @@ -7509,7 +7509,7 @@ function _ble_edit_exec_gexec__save_lastarg {
# space, the adjustments for the editor mode is unnecessary. Rather, it
# would wrongly saves the file descriptors for the editor space as those for
# the user space and causes a loss of the user's file descriptors.
[[ $_ble_edit_exec_inside_userspace ]] && return "$_ble_edit_exec_lastexit"
[[ $_ble_edit_exec_inside_userspace ]] || return "$_ble_edit_exec_lastexit"

_ble_edit_exec_inside_userspace=
_ble_edit_exec_TRAPDEBUG_enabled=
Expand Down Expand Up @@ -7548,6 +7548,9 @@ function _ble_edit_exec_gexec__epilogue {
# Note: $_ は同じ eval の中でないと取れないのでここでは読み取らない。
_ble_exec_time_EPOCHREALTIME_end=${_ble_exec_time_EPOCHREALTIME_end:-$EPOCHREALTIME} \
_ble_edit_exec_lastexit=$?

[[ $_ble_edit_exec_inside_prologue ]] || return 0

_ble_edit_exec_inside_userspace=
_ble_edit_exec_TRAPDEBUG_enabled=
# Note: 他の関数呼び出しよりも先
Expand Down

0 comments on commit 670c7ea

Please sign in to comment.