Ticket #3047 (closed defect: fixed)

Opened 11 years ago

Last modified 11 years ago

Cmdline directory handling broken

Reported by: rebel Owned by: andrew_b
Priority: major Milestone: 4.8.11
Component: mc-core Version: 4.8.10
Keywords: Cc: gotar@…, egmont@…, onlyjob@…
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master

Description

This might be related to ticket 2783 (which is marked as fixed, though
the same behavior does not work for me).

I see two issues, possibly related:

  • if I run 'mc /dir1 /dir2', mc opens /dir1, while /dir2 is ignored
  • I have in panels.ini in [Dirs] current_is_left=1, but current is always right

bash$ LC_MESSAGES=C mc -V
GNU Midnight Commander 4.8.9
Built with GLib 2.34.3
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 and Linux console
With support for X11 events
With internationalization support
With multiple codepages support
Virtual File Systems: cpiofs, tarfs, sfs, extfs, ftpfs, fish, smbfs
Data types: char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;

bash$ mc --configure-options
'--host=x86_64-suse-linux-gnu' '--build=x86_64-suse-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/lib' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-dependency-tracking' '--localstatedir=/var/lib' '--enable-charset' '--enable-vfs-smb' '--with-smb-configdir=/etc/samba' 'build_alias=x86_64-suse-linux-gnu' 'host_alias=x86_64-suse-linux-gnu' 'CFLAGS=-fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -W -Wall -Wstrict-prototypes -Wpointer-arith -Wformat-security -Wno-unused-parameter'

Change History

comment:1 in reply to: ↑ description ; follow-up: ↓ 9 Changed 11 years ago by andrew_b

  • Status changed from new to accepted
  • Owner set to andrew_b
  • Branch state changed from no branch to on review

Replying to rebel:

This might be related to ticket 2783 (which is marked as fixed, though
the same behavior does not work for me).

The better way was reopening of #2783 instead of creating new ticket (JFYI).

I see two issues, possibly related:

  • if I run 'mc /dir1 /dir2', mc opens /dir1, while /dir2 is ignored

Confirm. The following way is offered:

  • 'mc' (no arguments):

active panel uses current directory
passive panel uses "other_dir" from ini

  • 'mc dir1 dir2' (two arguments):

left panel uses dir1
right panel uses dir2

  • 'mc dir1' (single argument):

active panel uses current directory
passive panel uses dir1

  • I have in panels.ini in [Dirs] current_is_left=1, but current is always right

Works fine for me.
Make shure that you have that in the actual panels.ini (see user's config directory in output of mc -F).

Branch:3047_panel_dir_fix
changeset:de0f4de548fedb271b5c14baad99468e31c13c99

comment:2 Changed 11 years ago by angel_il

  • Votes for changeset set to angel_il

comment:3 Changed 11 years ago by slavazanko

  • Votes for changeset changed from angel_il to angel_il slavazanko
  • Branch state changed from on review to approved

comment:4 Changed 11 years ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset changed from angel_il slavazanko to committed-master
  • Resolution set to fixed
  • Branch state changed from approved to merged

comment:5 Changed 11 years ago by andrew_b

  • Status changed from testing to closed

comment:6 follow-up: ↓ 7 Changed 11 years ago by egmont

  • Status changed from closed to reopened
  • Resolution fixed deleted

Sorry guys for reopening, but are you absolutely sure that the current behavior is the intended one?

Beginning with mc-4.8.10, giving one directory in the command line (e.g. "mc /tmp") opens the current dir in the active panel, and the specified directory ("/tmp" in this example) in the other. This is totally counter-intuitive to me.

Almost all Unix tools allow you to specify "things" (files, hostnames etc.) on the command line, meaning to open that specified thing (e.g. "gimp foo.png" opens foo.png, "firefox google.com" navigates there etc.) so that you don't have to navigate (open that file, url etc.) within that applicaton.

Following this spirit, I often type "mc /path/to/some/dir" because I want do perform certain actions (renaming files, conveniently select which one to edit, etc...) with mc in *that* directory. I firmly believe that the only reasonable action is what mc up to 4.8.9 did: open *that* directory in the *active* panel so I can immediately go ahead and do stuff there.

comment:7 in reply to: ↑ 6 Changed 11 years ago by andrew_b

Ok, I see.

Would you offer your point of view for each case of mc arguments handling (see comment:1 here)?

comment:8 Changed 11 years ago by andrew_b

  • Votes for changeset committed-master deleted
  • Branch state changed from merged to no branch

comment:9 in reply to: ↑ 1 Changed 11 years ago by rebel

Replying to andrew_b:

Replying to rebel:

I see two issues, possibly related:

  • if I run 'mc /dir1 /dir2', mc opens /dir1, while /dir2 is ignored

Confirm. The following way is offered:

  • 'mc' (no arguments):

active panel uses current directory
passive panel uses "other_dir" from ini

Correct.
But see below on the current_is_left functionality- the "active" panel left if current_is_left=1, etc.

  • 'mc dir1 dir2' (two arguments):

left panel uses dir1
right panel uses dir2

I would argue that it should not be left+right, but similar to the above- dir1 should be the "active" panel, meaning left if current_is_left=1, etc.

  • 'mc dir1' (single argument):

active panel uses current directory
passive panel uses dir1

This should the other around, if I am running 'mc dir1', then I want to work in that dir1. So definitely "active" panel should use dir1; passive panel should use "other_dir".

  • I have in panels.ini in [Dirs] current_is_left=1, but current is always right

Works fine for me.
Make shure that you have that in the actual panels.ini (see user's config directory in output of mc -F).

Ah, apparently the config dir moved from ~/.mc to ~/.config/mc at some point in time.
Haven't noticed that :-/ Thanks.

However, it still "does not work" or works only partially: the variable changes only where
the focus is (the cursor), not which panel opens that directory. The directory is opened
always on the left, no matter what the setting contains.

comment:10 Changed 11 years ago by andrew_b

  • Status changed from reopened to accepted
  • Version changed from 4.8.9 to 4.8.10
  • Branch state changed from no branch to on review
  • Milestone changed from 4.8.10 to 4.8.11

comment:11 Changed 11 years ago by gotar

  • Cc gotar@… added

comment:12 Changed 11 years ago by egmont

  • Cc egmont@… added

comment:13 Changed 11 years ago by egmont

Sorry the slow response. Apparently the original reporter agreed with me on the "mc dir1" case and it's fixed by andrew_b's recent change. Thanks guys!

I don't see what changed after all between 4.8.9 and 4.8.11, probably something that I don't personally use :)

comment:14 Changed 11 years ago by egmont

The two directory case is indeed an interesting question. If the active panel is the left one then it's obvious. But if the active panel is the right one, then the two possible ways both have their own pros.

One might argue for the "visual" solution: the command line visually looks like "mc dir1 dir2" then mc should open visually with "dir1 dir2" panels, rather than switching the two sides.

Others might argue for the "semantical" solution: the command line "mc dir1 dir2" means that I want to work with dir1 straight away, and also have dir2 easily accessible, so they should appear visually in "dir2 dir1" order with dir1 on the right having the focus.

I personally prefer the active directory to be the left one, so it doesn't matter for me, I don't vote for one or the other, just wanted to clarify the question.

comment:15 Changed 11 years ago by slavazanko

  • Votes for changeset set to slavazanko

comment:16 Changed 11 years ago by onlyjob

  • Cc onlyjob@… added

comment:17 Changed 11 years ago by angel_il

  • Votes for changeset changed from slavazanko to slavazanko angel_il
  • Branch state changed from on review to approved

comment:18 Changed 11 years ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset changed from slavazanko angel_il to committed-master
  • Resolution set to fixed
  • Branch state changed from approved to merged

comment:19 Changed 11 years ago by andrew_b

  • Status changed from testing to closed

The previous (before this ticket) behavior is restored: in case of two directories in the command line, 1st directory is shown in the active panel, 2nd directory is shown in the passive one.

Note: See TracTickets for help on using tickets.