Skip to content
Open
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
9 changes: 8 additions & 1 deletion zoxide.lua
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,14 @@ local function __zoxide_z(keywords)
if keyword == '-' then
return __zoxide_cd '-'
else
local path = os.getfullpathname(unquote(keyword))
local unquoted_keyword = unquote(keyword)
if unquoted_keyword:sub(1, 1) == '~' then
local home = os.getenv('HOME')
if home then
unquoted_keyword = unquoted_keyword:gsub('^~', home)
end
end
local path = os.getfullpathname(unquoted_keyword)
if path and os.isdir(path) then
return __zoxide_cd(path)
end
Expand Down