Thanks to visit codestin.com
Credit goes to github.com

Skip to content

blurb does not support command line options in EDITOR/GIT_EDITOR #2

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

Closed
nirs opened this issue Jul 21, 2017 · 3 comments
Closed

blurb does not support command line options in EDITOR/GIT_EDITOR #2

nirs opened this issue Jul 21, 2017 · 3 comments
Assignees

Comments

@nirs
Copy link
Contributor

nirs commented Jul 21, 2017

On windows users may like to configure their editor with options:

$ git config --global core.editor "'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -nosession"

See https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup

blurb assume that EDITOR/GIT_EDITOR environment variables are executable names, so it will fail to run the user configured editor:

$ EDITOR="'foo bar' --baz" ../../core-workflow/blurb/blurb.py 
Traceback (most recent call last):
  File "../../core-workflow/blurb/blurb.py", line 1527, in <module>
    main()
  File "../../core-workflow/blurb/blurb.py", line 1487, in main
    sys.exit(fn(*filtered_args, **kwargs))
  File "../../core-workflow/blurb/blurb.py", line 804, in add
    subprocess.run([editor, tmp_path])
  File "/usr/lib64/python3.5/subprocess.py", line 383, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib64/python3.5/subprocess.py", line 676, in __init__
    restore_signals, start_new_session)
  File "/usr/lib64/python3.5/subprocess.py", line 1282, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: "'foo bar' --baz"
@nirs
Copy link
Contributor Author

nirs commented Jul 21, 2017

Here is an example run using command with spaces (typical on windows) and command line options:

Creating editor with spaces in path:

ln -s /usr/bin/vim 'my_editor'

Trying to use 'my editor' with blurb master:

$ EDITOR="$PWD/'my editor' +25" ../../core-workflow/blurb/blurb.py
Traceback (most recent call last):
  File "../../core-workflow/blurb/blurb.py", line 1527, in <module>
    main()
  File "../../core-workflow/blurb/blurb.py", line 1487, in main
    sys.exit(fn(*filtered_args, **kwargs))
  File "../../core-workflow/blurb/blurb.py", line 804, in add
    subprocess.run([editor, tmp_path])
  File "/usr/lib64/python3.5/subprocess.py", line 383, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib64/python3.5/subprocess.py", line 676, in __init__
    restore_signals, start_new_session)
  File "/usr/lib64/python3.5/subprocess.py", line 1282, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: "/home/nsoffer/src/cpython/debug/'my editor' +25"

larryhastings referenced this issue in larryhastings/core-workflow Dec 21, 2017
EDITOR might contain spaces.  If it does, is that
just a path with spaces?  Or is it a command-line with
arguments?  blurb now handles all these cases.
@larryhastings
Copy link
Contributor

Please see python/core-workflow#206 .

larryhastings referenced this issue in python/core-workflow Jan 23, 2018
EDITOR might contain spaces.  If it does, is that
just a path with spaces?  Or is it a command-line with
arguments?  blurb now handles all these cases.
@hugovk hugovk transferred this issue from python/core-workflow Mar 27, 2024
@hugovk
Copy link
Member

hugovk commented Oct 12, 2024

python/core-workflow#206 has been merged and released, closing.

@hugovk hugovk closed this as completed Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants