jeffreytse / zsh-vi-mode

💻 A better and friendly vi(vim) mode plugin for ZSH.
MIT License
3.13k stars 109 forks source link

Fix temp dir creation when TMPDIR is set and has no trailing slash #146

Closed pschmitt closed 2 years ago

pschmitt commented 2 years ago

TMPDIR when set usually does not include a trailing slash.

This here fixes the tmpdir creation when editing the current cmdline, which leads to the following when TMPDIR doesn't end with /:

> my-very-long-command
# bindkey for editing the command line
mktemp: failed to create file via template ‘/tmpzshXXXXXX’: Permission denied

zvm_vi_edit_command_line:7: no such file or directory:

Having a static / in the tmpdir filename works in both cases since /tmp//zvm is the same as /tmp/zvm

pschmitt commented 2 years ago

Sure thing. Anything holding you back from merging this one in?

jeffreytse commented 2 years ago

@pschmitt Recently I'm quite busy, sorry for the late reply. : )