Package: thunar
Version: 1.8.4-1
Severity: normal
Tags: upstream

Dear Maintainer,

It seems to be the case that Thunar 1.8.4-1 does not provide correct
file names as %F parameter when a custom action is involved via
keyboard shortcut. It's fine when not invoked via keyboard shortcut
but using the mouse via the context menu of the selected file.

* What led up to the situation?

- Open Thunar.

- Change to empty directory "/home/vk/tmp/2del/2020-06-07-thunar-bug/".

- In the background, create an empty test file via "touch foo" in
  the shell.

- Thunar is showing the test file instantly.

- Invoke a custom action that does change the file name via the 
  keyboard shortcut "Alt-a". As custom action I am using 
  https://github.com/novoid/appendfilename which is called in a
  wrapper script that includes a gnome-terminal call for user
  interaction in a separate terminal window. Details should not be
  related to the Thunar issue at all. Any shell script that
  displays the provided parameters and adds additional text to the
  file name should cause the same effects.

- The "appendfilename" wrapper script gets the current Thunar file 
  selection via the "%F" parameter defined in Edit -> Configure 
  custom actions ...

- Running "appendfilename" with "--verbose" shows me that it got one
  parameter which is "/home/vk/tmp/2del/2020-06-07-thunar-bug" (the
  folder name without the selected file) instead of
  "/home/vk/tmp/2del/2020-06-07-thunar-bug/foo". Therefore, renaming 
  fails for "appendfilename".

Thunar uses the directory name instead of the absolute path
including the selected file when invoking a custom action via
keyboard shortcut.

- Invoking the "appendfilename" via keyboard shortcut a second time 
  leads to the very same result.
  
This shows the reproducibility of the issue.

- Using the context menu of the mouse to invoke the "appendfilename"
  wrapper script leads to proper file name sent to the custom
  action. I may now add " 1" to the file name which results in the
  changed file name "foo 1".

Thunar is providing the correct file name for custom actions invoked
by the context menu (via mouse). (Good case)

- Thunar now displays the correct "foo 1" in the folder.

- When invoking the keyboard shortcut once again, the custom action
  now gets the file name
  "/home/vk/tmp/2del/2020-06-07-thunar-bug/foo" which is the
  previous file name before the successfull renaming process in the
  previous steps.

Thunar is providing an old file name when invoking the custom action
via keyboard shortcut.

- Using the mouse to invoke "appendfilename" on "foo 1" via the
  context menu leads to a successful rename process.


Starting from scratch in the test folder: I remove all files and
create a new test file via: touch "This is a test file.txt"

Keyboard shortcut custom action now gets:
   "/home/vk/tmp/2del/2020-06-07-thunar-bug/foo 1"

Mouse custom action now gets:
  "/home/vk/tmp/2del/2020-06-07-thunar-bug/This is a test file.txt"
I add " foo" which results in:
  "/home/vk/tmp/2del/2020-06-07-thunar-bug/This is a test file foo.txt"

eyboard shortcut custom action now gets:
  "/home/vk/tmp/2del/2020-06-07-thunar-bug/This is a test file.txt"

"View -> Reload" in-between did not change anything.

Clicking somewhere else and re-selecting the file before invoking
the keyboard shortcut did not change anything.

Therefore: the issue is not related to a specific file name or the
mouse selection process.


* What was the outcome of this action?

The outcome was that custom actions that are using %F to get file
selections do not get the correct file name that is selected. It
either gets the directory name or an outdated file as shown above.

Maybe an off-by-one issue with some kind of file selection buffer?


* What outcome did you expect instead?

There should not be a difference on the content of %F for custom
actions that are invoked via mouse and context menu or via keyboard
shortcut. Both should deliver the current file selection properly.


As a result, customs actions on file selections and %F can not be
used with keyboard shortcuts in Thunar 1.8.4-1.


-- System Information:
Debian Release: 10.4
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.19.0-9-amd64 (SMP w/4 CPU cores)
Kernel taint flags: TAINT_USER, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_US.utf8), LANGUAGE=en_US:en (charmap=UTF-8) (ignored: LC_ALL set to 
en_US.utf8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages thunar depends on:
ii  desktop-file-utils  0.23-4
ii  exo-utils           0.12.4-1
ii  libatk1.0-0         2.30.0-2
ii  libc6               2.28-10
ii  libcairo2           1.16.0-4
ii  libexo-2-0          0.12.4-1
ii  libgdk-pixbuf2.0-0  2.38.1+dfsg-1
ii  libglib2.0-0        2.58.3-2+deb10u2
ii  libgtk-3-0          3.24.5-1
ii  libgudev-1.0-0      232-2
ii  libice6             2:1.0.9-2
ii  libnotify4          0.7.7-4
ii  libpango-1.0-0      1.42.4-8~deb10u1
ii  libsm6              2:1.2.3-1
ii  libthunarx-3-0      1.8.4-1
ii  libxfce4ui-2-0      4.12.1-3
ii  libxfce4util7       4.12.1-3
ii  libxfconf-0-2       4.12.1-1
ii  shared-mime-info    1.10-1
ii  thunar-data         1.8.4-1

Versions of packages thunar recommends:
ii  dbus-user-session [default-dbus-session-bus]  1.12.16-1
ii  dbus-x11 [dbus-session-bus]                   1.12.16-1
ii  gvfs                                          1.38.1-5
ii  libcairo-gobject2                             1.16.0-4
ii  libpangocairo-1.0-0                           1.42.4-8~deb10u1
ii  libxfce4panel-2.0-4                           4.12.2-1
ii  policykit-1-gnome [polkit-1-auth-agent]       0.105-7
ii  thunar-volman                                 0.9.1-1
ii  tumbler                                       0.2.3-1
ii  udisks2                                       2.8.1-4
ii  xdg-user-dirs                                 0.17-2

Versions of packages thunar suggests:
ii  thunar-archive-plugin     0.4.0-2
ii  thunar-media-tags-plugin  0.3.0-2

-- no debconf information

Reply via email to