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

out of memory error after "edit-command-line"



Hi everyone,

ZSH_VERSION: 5.8 (Distribution, Devuan, still hasn't update)
$ZSH_PATCHLEVEL:  debian/5.8-6+deb11u1
default editor nvim version v0.4.4
Also tested with VIM - Vi IMproved 8.2
terminal emulators/multiplexer:  tmux, xfce4-terminal, st, and kitty(checked on all)

.zshrc
  autoload -Uz edit-command-line
  zle -N edit-command-line
  bindkey -M vicmd v edit-command-line

Created an anonymous function(see attachment ps_via_zsh) by entering edit-command-line
which seems to work ok after exiting editor and hitting enter. But then(after adding code) started
getting out of memory errors(see attachment out_of_memory).  When I recall the anonymous
function from history and execute, no error. Started commenting out lines and found that the issues
stops with the line:

CL=${(0A)$(</proc/$P/cmdline)} ; PP=${AA[PPid]} ; Cmd=${AA[Name]}

commented out. Splitting line found issue to be with CL=${(0A)$(</proc/$P/cmdline)}
Again, recalling from history -- no edit-command-line -- no error.
BTW: /proc/<pid>/cmdline uses NULL as the separator.

QUESTION:  Bug, or am I doing something stupid? Or something with nvim and vim?

Thanks for listening,

Jim Murphy

Attachment: ps_via_zsh
Description: Binary data

Attachment: out_of_memory
Description: Binary data



Messages sorted by: Reverse Date, Date, Thread, Author