-
Notifications
You must be signed in to change notification settings - Fork 10
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
Terminal command is a little too strict #9
Comments
While I agree that current way is bit too strict (I've personally hit a wall with
And I just set my terminal to this script. |
@immae can you please elaborate on the {} part? I am writing a fork of this project, and this is indeed an issue I want to fix. I am interested in your approach as it seems more flexible. |
@Farzat07 this is a bit old and I forked the script for other additional reasons, but here is my implementation of what I meant above: def hook_editor_process(terminal, editor, path, buf):
if "{}" in editor:
editor_cmd = editor.format(path)
else:
editor_cmd = "{} {}".format(editor, path)
if "{}" in terminal:
command = terminal.format(editor_cmd)
else:
command = "{} -e \"{}\"".format(terminal, editor_cmd)
weechat.hook_process(command, 0, "editor_process_cb", buf) The goal is to not break existing situations, except when the editor or terminal setting contains a |
Actually I am interested in seeing your fork and implementing any
general-enough stuff.
Can you send me a link to your fork?
…On 22/05/17 01:24am, Immae wrote:
@Farzat07 this is a bit old and I forked the script for other additional reasons, but here is my implementation of what I meant above:
```
def hook_editor_process(terminal, editor, path, buf):
if "{}" in editor:
editor_cmd = editor.format(path)
else:
editor_cmd = "{} {}".format(editor, path)
if "{}" in terminal:
command = terminal.format(editor_cmd)
else:
command = "{} -e \"{}\"".format(terminal, editor_cmd)
weechat.hook_process(command, 0, "editor_process_cb", buf)
```
The goal is to not break existing situations, except when the editor or terminal setting contains a `{}` (which should be rare enough), in which case we replace it like above
--
Reply to this email directly or view it on GitHub:
#9 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
I don’t have a fork, I just keep the file in my local directory: Notable changes:
|
Ok, I successfully implemented this in my fork. |
tmux users would probably like to be able to set their terminal command to something like:
Which is currently impossible in the current state, since an "-e" is added to the terminal, and the command is necessarily added at the end.
I can make the implementation if necessary, but would a change like this be accepted:
{}
, then use python format on itThe text was updated successfully, but these errors were encountered: