Semantic history path incorrect
- iTerm2 version: 3.3.0beta8
- OS version: 10.14.4
- com.googlecode.iterm2.plist
- debuglog.txt
I have my Semantic History set up to Always run command...
with the argument of /usr/local/bin/bash /Users/dan/bin/maybe-edit-file.sh \(semanticHistory.workingDirectory) \(semanticHistory.path) \(semanticHistory.lineNumber)
The script has this at the top:
debug_log=/tmp/dan.dbg
echo ---- >> ${debug_log}
cwd=$1
filename=$2
lineno=$3
filepath=${cwd}/${filename}
echo cwd=$cwd >> ${debug_log}
echo filename=$filename >> ${debug_log}
echo lineno=$lineno >> ${debug_log}
echo filepath=$filepath >> ${debug_log}
echo pwd: $(pwd) >> ${debug_log}
I run ls
on my current directory (~/tmp/iterm-dbg
) when not in my homedir and ⌘-click a file named README.md
in the current dir:
This is what shows up in my debug log:
cwd=/Users/dan
filename=README.md
lineno=
filepath=/Users/dan/README.md
pwd: /
Without any indication (either via the pwd or the cwd) I can't properly access the file.
I thought that in a prior version of iTerm this worked because the working directory of the script run was the directory I was in when I ⌘-clicked (i.e. my debug log would have shown pwd: /Users/dan/tmp/iterm-dbg
), but I can't be sure without reverting and testing the old version that I didn't change something else too.