! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
[Suggestion] Start archive application from file's directory
Status:
RESOLVED: FIXED
Product:
Thunar-archive-plugin
Component:
General

Comments

Description Alexander Kurakin 2018-10-19 15:31:22 CEST
Good day!

xarchiver is started by clicking "Extract to..." context menu item.

But present working directory is the home directory for xarchiver in this case. I've taken it from an experiment.

And this this uncomfortable: point "." in the extract dialog extracts archive to the home directory.

Let's change this behavior?

Thanks!
Comment 1 alexxcons editbugs 2018-10-19 21:35:08 CEST
Would be ok for me to change the default to current directory, instead of $HOME

It's the same for file-roller, so I guess the directory is passed by the archive-plugin ( or none is passed and $HOME is the default )

Like always, patches are welcome !
Comment 2 Alexander Kurakin 2018-10-20 00:17:55 CEST
Well I'm far from Thunar's ode and have environment for 0.3.1 version plugin only... But ok :)

Take a look, please!
Comment 3 Alexander Kurakin 2018-10-20 00:18:48 CEST
Created attachment 8047 
Proposed patch for 0.3.1
Comment 4 alexxcons editbugs 2018-10-21 00:34:11 CEST
Thanks alot for the patch,  works fine here !

On master I had to throw out the extra part for thunarx 0,4,1 to get it compiled (against thunarx-3 )
Comment 5 alexxcons editbugs 2018-10-21 00:46:11 CEST
Created attachment 8050 
patch for master

Repo looks like it is not forseen to release a 0.3.2. 
All tags are directly on master, which is already at 0.4.0, using thunarx-3 API.

So I would just push it to master, will than work together with thunar 1.8.x
Comment 6 alexxcons editbugs 2018-10-21 00:54:48 CEST
Created attachment 8051 
patch for master

fixed author
Comment 7 alexxcons editbugs 2018-10-23 22:35:57 CEST
Sorry, false positive .. looks like it as well works fine for me without your fix for xarchiver :P

Possibly you are using a different xarchiver.tap  ?

I am using the one from here:

https://github.com/ib/xarchiver/blob/master/xarchiver.tap

Usually it should be installed together with xarchiver (that was not the case for me)
Try "locate xarchiver.tap" to figure out where it is installed on your system. For me it is installed here:
/usr/local/libexec/thunar-archive-plugin

Funny thing is, for file-roller you patch works well :P  And for some weird reason, it does not help to replace $(folder) with $(pwd) in the file-roller.tap

... need to do some more investigation
Comment 8 Alexander Kurakin 2018-10-24 11:35:02 CEST
It's not about xarchiver only. According to this line (https://github.com/xfce-mirror/thunar-archive-plugin/blob/e5aeedbb7417f822b914bbd0714f636df6db7d3b/thunar-archive-plugin/tap-provider.c#L319):

    default_dir = g_get_home_dir ();

So, current directory (pwd) in *every* tap script (we consider "Extract to" operation) will be $HOME.

I don't see a possibility why it works for you. (BTW I also thought that it's a tap-script error. Then found that line.)

Note we talk about "Extract to". "Extract here" has another situation, see code an the neighbor function.
Comment 9 alexxcons editbugs 2018-10-25 23:28:53 CEST
Created attachment 8061 
patch for master

Ok, thanks fot that hint. Actually it worked for my xarchiver, because the tap script I use does not use $pwd or $folder for "extarct to". Looks like xarchiver automatically used the current directory as default. ( as well file-roller does, but thats not a behaviour we should rely on)

There seems to be a second problem:
$pwd is used in some tap scripts. But actually it does not have a value at all ! (You can just echo it in the script)
( for some strange reason "echo $PWD" prints the $HOME path )

This leads to unwanted effects ... xarchiver/file-roller will default to $HOME when "--extract-to" is used with empty argument. So I will as well rename the variables in the tab-files: $folder --> $pwd  (so the non working old $pwd can stay where it is )

I modified your patch further:
- Use the simplified code from 'tap_create_archive' --> no indentation
- rename $folder to $pwd in all tab-files

I tested all related scripts, the all now work fine for me.
Comment 10 Alexander Kurakin 2018-10-26 20:09:31 CEST
Ok, thanks!
Comment 11 Git Bot editbugs 2018-10-30 20:39:35 CET
Alexander Schwinn referenced this bugreport in commit 5a63c61a2a2bcb18b59e610fa036ae092e08adc1

Start archive application from file's directory (Bug #14773)

https://git.xfce.org/thunar-plugins/thunar-archive-plugin/commit?id=5a63c61a2a2bcb18b59e610fa036ae092e08adc1
Comment 12 alexxcons editbugs 2018-10-30 20:42:51 CET
Finally pushed the patch, will be released in v0.4.1

Thanks as well for your contribution !

Bug #14773

Reported by:
Alexander Kurakin
Reported on: 2018-10-19
Last modified on: 2018-10-30

People

Assignee:
alexxcons
CC List:
3 users

Version

Version:
unspecified

Attachments

Proposed patch for 0.3.1 (2.21 KB, patch)
2018-10-20 00:18 CEST , Alexander Kurakin
no flags
patch for master (2.26 KB, patch)
2018-10-21 00:46 CEST , alexxcons
no flags
patch for master (2.26 KB, patch)
2018-10-21 00:54 CEST , alexxcons
no flags
patch for master (4.06 KB, patch)
2018-10-25 23:28 CEST , alexxcons
no flags

Additional information