Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Opening a file descriptor for reading with exec breaks vim shell
- X-seq: zsh-workers 45828
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Opening a file descriptor for reading with exec breaks vim shell
- Date: Fri, 15 May 2020 06:57:10 +0200
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Prerequisites:
1. Install vim.
2. Configure vim so that :shell command opens zsh. Setting zsh as your
login shell is one way to do it.
Reproduce:
adam% vim
:shell
adam% exec {fd}</dev/null
adam% exit
zsh: suspended (tty output) vim
adam%
The expected behavior is to not have vim suspended.
Replacing `exec {fd}</dev/null` with any of the following fixes the problem:
exec 3</dev/null
exec {fd}>/dev/null
zmodload zsh/system && sysopen -ru fd /dev/null
zmodload zsh/system && sysopen -ru fd1 /dev/null && exec {fd2}<&$fd1
Replacing `exec {fd}</dev/null` with any of the following does NOT fix
the problem:
exec 0</dev/null
exec {fd}</dev/null && exec {fd}<&-
All tests were performed with zsh-5.8-131-g06c0a39 (tip of master as
of this writing) and no rc files.
Roman.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author