Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Dec 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions zsh-vi-mode.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
# the editor to edit your command line (default is $EDITOR)
#
# ZVM_TMPDIR
# the temporary directory (default is $TMPDIR, otherwise it's /tmp/)
# the temporary directory (default is $TMPDIR, otherwise it's /tmp)
#
# ZVM_TERM
# the term for handling terminal sequences, it's important for some
Expand Down Expand Up @@ -312,7 +312,7 @@ fi
: ${ZVM_VI_HIGHLIGHT_FOREGROUND:=#eeeeee}
: ${ZVM_VI_HIGHLIGHT_EXTRASTYLE:=default}
: ${ZVM_VI_EDITOR:=${EDITOR:-vim}}
: ${ZVM_TMPDIR:=${TMPDIR:-/tmp/}}
: ${ZVM_TMPDIR:=${TMPDIR:-/tmp}}

# Set the term for handling terminal sequences, it's important for some
# terminal emulators to show cursor properly (default is $TERM)
Expand Down Expand Up @@ -1747,7 +1747,7 @@ function zvm_range_handler() {
# Edit command line in EDITOR
function zvm_vi_edit_command_line() {
# Create a temporary file and save the BUFFER to it
local tmp_file=$(mktemp ${ZVM_TMPDIR}zshXXXXXX)
local tmp_file=$(mktemp ${ZVM_TMPDIR}/zshXXXXXX)

# Some users may config the noclobber option to prevent from
# overwriting existing files with the > operator, we should
Expand Down