-
-
Notifications
You must be signed in to change notification settings - Fork 471
Update cot CLI behavior
#1842
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
Update cot CLI behavior
#1842
Conversation
|
Thank you for the PR. |
|
I have not looked at the code, but as a user would love to see --new go away - it breaks the assumed CLI behavior of myself and many programs calling cot. |
|
Considering that CotEditor aims to provide a macOS-native experience, I guess that this behavior was originally intended to align with how That said, I think it is much more convenient when a new file is automatically created. What do you think about introducing an environment variable to control this behavior? For example, if |
I think thats a complication that users of a simpler editor like cot would prefer not to need to deal with. Cot should follow the general trend of other editors - particularly in the command line interface so that it can be used as ones general purpose editor. As it is, due to --new, I have to keep sublime around for EDITOR uses... |
|
@matteocarnelos It took me some time to decide, but I still conclude that, at least at this point, the requested specification change is not suitable for CotEditor. As @stonechoe also pointed out, CotEditor aims to be a GUI application provides a native macOS experience, and the CUI exists just to support the operation of CotEditor.app. Additionally, and this is a system limitation, the macOS sandboxing restrictions are becoming stricter every year. Currently, there are already limited ways to pass file paths from the command line to GUI applications for editing, so I also don't want to make this the standard approach. In any case, I appreciate your suggestion. |
|
@1024jp I see. Thanks anyway for the consideration. I will still keep the fork up in case anyone wants to try the proposed behavior by manually patching the |
This PR updates the behavior of the
cotCommand Line Interface by aligning it to the one of other editors (e.g. Vim, Nano, Emacs, etc.).I bumped the version to
6.0.0as this PR introduces breaking changes to the interface (e.g. the--newflag is removed).Fixes #1776.
The new behavior is highly inspired by Vim, meaning that:
cotopens a new untitled documentcot FILE1 FILE2 ..., for each path:The rest is left unchanged.
Although I performed some tests, feel free to perform more. To temporarily test the new behavior (until the next CotEditor update), backup the old command and replace it with the one in this PR: