Description
When Ghostel is used from Eshell with Evil integration, entering Evil insert mode at an earlier position in the Ghostel buffer after the child process has exited causes Ghostel to try to write to the closed process channel.
The following error is displayed:
ghostel--send-encoded: ghostel: error in ghostel--encode-key: NotOpenForWriting
Steps to reproduce
-
Start Emacs and evaluate the following configuration:
(require 'evil)
(require 'ghostel)
(require 'evil-ghostel)
(require 'eshell)
(require 'ghostel-eshell)
(add-hook 'ghostel-mode-hook 'evil-ghostel-mode)
(ghostel-eshell-visual-command-mode)
(evil-mode)
-
Open Eshell.
-
Run:
-
After Codex has started, perform these actions in order:
- Type
/exit.
- Press
ESC to enter Evil normal mode.
- Press
RET (Enter).
- Move the cursor upward into the initial messages near the beginning of the buffer.
- Wait for the Codex process to stop.
- Press
a or i to enter Evil insert mode.
Actual behavior
Entering insert mode raises this error:
ghostel--send-encoded: ghostel: error in ghostel--encode-key: NotOpenForWriting
Workaround
Move the cursor to the end of the buffer before entering insert mode. No error occurs in that case, and pressing q closes the buffer.
Guess
Write a simple bash script
echo hello
sleep 5
echo world
After repeating the above steps, the issue isn't appeared. I guess this issue is
caused by some special escape charactels.
Description
When Ghostel is used from Eshell with Evil integration, entering Evil insert mode at an earlier position in the Ghostel buffer after the child process has exited causes Ghostel to try to write to the closed process channel.
The following error is displayed:
Steps to reproduce
Start Emacs and evaluate the following configuration:
Open Eshell.
Run:
After Codex has started, perform these actions in order:
/exit.ESCto enter Evil normal mode.RET(Enter).aorito enter Evil insert mode.Actual behavior
Entering insert mode raises this error:
Workaround
Move the cursor to the end of the buffer before entering insert mode. No error occurs in that case, and pressing
qcloses the buffer.Guess
Write a simple bash script
After repeating the above steps, the issue isn't appeared. I guess this issue is
caused by some special escape charactels.