Closed r6e closed 5 years ago
Thank you for the perfect issue report.
As you mentioned, --wait
failed because the application name and process name are different in iTerm.
So, I changed to invoke the client not by application name but by the path to the application.
This way is more reliable not only for iTerm but also for cases such as when there are more than two applications whose name are the same in different places.
I'll ship this fix with the next CotEditor, which will be released in the next week. Thank you!
Issue and Steps to Reproduce
When using
cot -w
within iTerm2,cot
raises asubprocess.CalledProcessError
when the applicable window is closed or CotEditor is exited (see screenshots). This is not resolved using the steps detailed in CotEditor issue #877.Error Text
Steps to Reproduce
From within iTerm2:
$ touch test.txt
$ cot -w test.txt
Possible Cause
This appears to be caused by lines 315 and 136.
On line 315,
client_name
is set to the process name, which in the case of iTerm2 isiTerm2
. However, on line 136, the generated script references the app name, which for iTerm2 isiTerm
. The result is thatosascript
can not find the correct app and fails.Possible Solution
If the cause above is correct, then this is due to iTerm2's unusual conventions. However, since these conventions are still valid, it might make sense to account for them in
cot
.This could potentially be fixed by using consistent references to refer to the client app; either always the app name or the process name. However, I am not too familiar with
osascript
, so this may not be possible or reasonable, depending on context.Versions
cot
: 2.7.3Screenshots
Reproducing Error
macOS Privacy Settings
Included to verify this isn't caused by CotEditor #877