Skip to content
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

When nothing is typed for macro %{some text} in a user menu entry, the rest of the script is not run #3891

Open
mc-butler opened this issue Dec 21, 2017 · 0 comments
Labels
area: core Issues not related to a specific subsystem prio: low Minor problem or easily worked around

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/3891
Reporter marcelpaulo (@marcelpaulo)
Keywords macro, enter, exit

mc version: 4.8.19-1 (from Ubuntu repository)
environment: Xubuntu 17.10

When the macro %{some text} is used in a user menu entry, and nothing is typed — if only key <enter> is pressed —, the rest of the commands are not run, as if the script exited.

I'm not sure if this is the expected behavior. The man page doesn't mention anything, only that F10 or ESC can cancel.

It would be interesting if the script didn't exit, so that the variable receiving the text from the macro could be tested for empty/undefined.

Steps to reproduce

  1. Create a user menu entry like this one:
x   testing
    text=%{enter any text}
    echo "text = $text"
  1. Run the user menu, select this entry, and press <enter>
  1. Press ctrl-o to check if there was any output

There will be no output, as if the script exited before echo "text = $text was run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: core Issues not related to a specific subsystem prio: low Minor problem or easily worked around
Development

No branches or pull requests

1 participant