coteditor / cot

Command-line helper tool for CotEditor
https://coteditor.com/cot
Apache License 2.0
55 stars 11 forks source link

The script fails to open paths or stdin containing backslash character #6

Closed vbadeasv closed 5 years ago

vbadeasv commented 5 years ago

STR

Expected results:

Actual results:

Traceback (most recent call last):
  File "/Applications/CotEditor.app/Contents/SharedSupport/bin/cot", line 360, in <module>
    main(args, stdin)
  File "/Applications/CotEditor.app/Contents/SharedSupport/bin/cot", line 289, in main
    app.tell_document('set contents to "{}"'.format(sanitized_stdin))
  File "/Applications/CotEditor.app/Contents/SharedSupport/bin/cot", line 153, in tell_document
    return self.tell('tell document {} to {}'.format(index, script))
  File "/Applications/CotEditor.app/Contents/SharedSupport/bin/cot", line 120, in tell
    return run_osascript(script, is_async)
  File "/Applications/CotEditor.app/Contents/SharedSupport/bin/cot", line 92, in run_osascript
    raise CalledProcessError(p.returncode, script)
subprocess.CalledProcessError: Command 'tell app "/Applications/CotEditor.app" to tell document 1 to set contents to "te\st"' returned non-zero exit status 1

Note:

1024jp commented 5 years ago

Fixed in #7.