Ticket #3891 (new defect)

Opened 2 years ago

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

Reported by: marcelpaulo Owned by:
Priority: minor Milestone: Future Releases
Component: mc-core Version: master
Keywords: macro enter exit Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description

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.

Note: See TracTickets for help on using tickets.