Tilix: "Open in Terminal" in Nemo does not open with the current directory

Created on 21 Mar 2016  路  7Comments  路  Source: gnunn1/tilix

The function "Open in Terminal" of the file manager Nemo (and probably others) does open Terminix correctly, but not with the current directory. Instead an new Terminix instance is opened with the default directory (user directory).

Terminix is set as the default terminal with:
gsettings set org.cinnamon.desktop.default-applications.terminal exec terminix
Using the -w parameter does not help here ("Open in Terminal" does nothing at all then).

Expected behavior: Terminix opens with the working directory set to the currently open/selected directory in Nemo.

Other terminal emulators like lxterminal or gnome-terminal work like expected.

bug

All 7 comments

Unfortunately, I don't use Nemo at all, I assume this is with the default Nemo "Open in Terminal" extension and not the Nautilus extension that Terminix ships? If you run Terminix manually with -w does it open as expected in the specified directory?

Yes, the function "Open in Terminal" is inbuilt and directly ships with Nemo. It provides a menu item in the right-click context menu and (my favorite) an optional icon for the toolbox.

Both the -w and the --working-directory parameters work as expected when manually running Terminix. The strange fact is that a working directory in gnome-terminal is also set with the parameter --working-directory. So it seems that the working directory is passed in a different way?

Thanks, I'll have a look and see what it is going on. In general if it works with gnome-terminal it should work with Terminix as I tried to mimic the command line arguments for compatibility.

I think I found the answer. Nemo actually does not set the directory via any command line argument, it just sets the working directory before spawning the command with g_spawn_async

See https://github.com/linuxmint/nemo/blob/5192708b0d4c46cf106a2ca623711d96b59553e6/src/nemo-view.c#L7077

I tested it: If I am inside $HOME/test and launch gnome-terminal, the instance of gnome-terminal will have $HOME/test set as the current directory. If I do the same with Terminix I end up in $HOME

Thanks @phw, yeah I'm naively using the user's home directory as the default. I'll switch this to using the cwd instead, should be an easy fix.

First of all I want to thank you, gnunn1 and all contributors, for all your hard work and efforts in the development of Terminix and your quick responses and solutions in regard to reported issues!

Unfortunately, the issue not completely solved yet. If an instance of Terminix is already open, then every new instance that is opened via the "Open in Terminal" function is set to the CWD of the old instance. But if there is no running instance of Terminix, then it works perfectly as expected.

I can reproduce outside of Nero, thanks for reporting it and I'll take care of it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alalfakawma picture alalfakawma  路  4Comments

viniciusban picture viniciusban  路  4Comments

gnunn1 picture gnunn1  路  3Comments

honze-net picture honze-net  路  3Comments

pkkid picture pkkid  路  3Comments