zsh-workers
 help / color / mirror / code / Atom feed
* Opening a file descriptor for reading with exec breaks vim shell
@ 2020-05-15  4:57 Roman Perepelitsa
  2020-05-17  9:03 ` Stephane Chazelas
  0 siblings, 1 reply; 4+ messages in thread
From: Roman Perepelitsa @ 2020-05-15  4:57 UTC (permalink / raw)
  To: Zsh hackers list

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-19 17:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-15  4:57 Opening a file descriptor for reading with exec breaks vim shell Roman Perepelitsa
2020-05-17  9:03 ` Stephane Chazelas
2020-05-18  8:35   ` Roman Perepelitsa
2020-05-19 17:31   ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).