-
Notifications
You must be signed in to change notification settings - Fork 3
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
External editor does not work with command line argument #4533
Comments
|
I see you don't use Pull Requests. I've attached a patch file. |
Thank you for the patch. Is this function covered by tests? Can you add a test? |
Unfortunately, the proposed patch is designed for single argument only. If more than one arguments are in $EDITOR: EDITOR="vi -R +", external editor isn't invocated at all.
The full-featured tokenizing in my_system_make_arg_array() is required. |
@zaytsev:
@andrew_b: |
|
|
|
Thank you very much, Andrew - especially for the tests! |
Important
This issue was migrated from Trac:
Dhalgren
(th.hammer@….net)When using an external editor for the "Edit" command (i.e. "Use internal edit" in the Configure Options is unchecked) the environment variable EDITOR is used. However, if $EDITOR contains a command line argument after the executable name, these arguments are not processed properly, and the editor might not be started at all.
How to reproduce:
(Precondition: vi is available on the system)
1.) On the command line, execute: export EDITOR="vi +" && mc
(the + argument should let vi start at the document's end instead of the beginning)
2.) Go to the Options menu -> Configuration -> uncheck "Use internal edit"
3.) Move the cursor to a file that is larger than a single screen (e.g. ABOUT-NLS in mc's source directory)
4.) Press F4 to start the external editor
Result: Nothing visible happens
Expected result: vi is opened showing the end of the file ABOUT-NLS
Output of LC_MESSAGES=C mc -V:
Output of LC_MESSAGES=C mc -F:
I have determined the cause of the problem and will provide a fix (which works for a single command line argument) via Pull Request.
Summary: In function utilunix.c:my_system_make_arg_array the GPtrArray storing the contents of argv is not filled correctly.
Note
Original attachments:
Dhalgren
(th.hammer@….net) onMar 28, 2024 at 6:43 UTC
The text was updated successfully, but these errors were encountered: