Ticket #3914 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

%view not piping command output to internal viewer in user menu

Reported by: marcelpaulo Owned by: andrew_b
Priority: major Milestone: 4.8.21
Component: mc-core Version: master
Keywords: Cc:
Blocked By: Blocking:
Branch state: approved Votes for changeset: committed-master

Description

I'm running mc that I built from source on Xubuntu 18.04:

git clone https://github.com/MidnightCommander/mc
./autogen.sh
./configure
make
sudo make install

Here's my version info:

+paulo:~$ mc -V
GNU Midnight Commander 4.8.20-133-g35d21b6ea
Built with GLib 2.56.1
Using the S-Lang library with terminfo database
With builtin Editor
With subshell support as default
With support for background operations
With mouse support on xterm
With support for X11 events
With internationalization support
With multiple codepages support
Virtual File Systems: cpiofs, tarfs, sfs, extfs, ftpfs, sftpfs, fish
Data types: char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;

I make extensive use of macro %view in ~/.config/menu to pipe the output of commands into the interval viewer. It worked correctly with the Ubuntu-packaged mc version 4.8.19. With my current version (4.8.20-133-g35d21b6ea), it shows on the internal viewer the script that the menu entry generated. It doesn't matter what shell commands the menu entry has: if it contains a single %view macro, activating the menu causes the script to be shown on the internal viewer.

It's very easy to reproduce:

  1. Create ~/.config/menu with a single entry:
x   foo
    %view date
  1. Press F2 to open the user menu, then press x
  1. Instead of showing the output of command date, this is shown on the interal viewer:
#! /bin/sh
 date

Strangely, the macro %view works as expected in ~/.config/mc/mc.ext. It just stopped working in the user menu.

Change History

comment:1 Changed 6 years ago by andrew_b

  • Owner set to andrew_b
  • Status changed from new to accepted
  • Milestone changed from Future Releases to 4.8.21

My bad.

The bad commit is [2043ef74a9f7fa70c5a5e641d4ef22882a64a910].

comment:2 Changed 6 years ago by andrew_b

  • Branch state changed from no branch to on review

comment:3 follow-up: ↓ 5 Changed 6 years ago by marcelpaulo

I searched the commits for %view before filing the issue, that's why I didn't find it ! I'll search better next time ! Thanks !

When does your revert commit gets mirrored to the git repo ?

comment:4 Changed 6 years ago by marcelpaulo

I've just reverted that commit (2043ef74a9f7fa70c5a5e641d4ef22882a64a910) and indeed %view is back working as expected again.

Thanks once again !

comment:5 in reply to: ↑ 3 Changed 6 years ago by andrew_b

  • Votes for changeset set to andrew_b
  • Branch state changed from on review to approved

Replying to marcelpaulo:

I searched the commits for %view before filing the issue, that's why I didn't find it ! I'll search better next time !

git bisect is the best way to find commit with bug.

When does your revert commit gets mirrored to the git repo ?

Right now.

comment:6 Changed 6 years ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset changed from andrew_b to committed-master
  • Resolution set to fixed

comment:7 Changed 6 years ago by andrew_b

  • Status changed from testing to closed

comment:8 Changed 6 years ago by marcelpaulo

Thanks, @andrew_b ! I've just pulled and installed master, all is good !

Note: See TracTickets for help on using tickets.