Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Opening a file descriptor for reading with exec breaks vim shell



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