Most of the time when you press Ctrl + n to open a new window, it's opened in the home directory instead of where you currently are. This can easily disturb workflows and lead to ugly hacks like opening a new tab instead and then making that tab a new window (which requires a lot of clicks). Opening a new tab actually works as expected.
It's not opened in the home directory if the instance of Tilix the key combination is performed on has been opened in a different location. That is: It has been launched by a different process whilst that process was in a different directory. However, if you navigate to some other directory in Tilix and then open a new Tilix instance, pressing Ctrl + N in this new instance still open a Tilix instance in the home directory. If you're confused at this point: Yeah, this is exactly why this is a problem. It's confusing as hell.
I haven't looked at your source code but suspect that this is because Tilix launches new instances of Tilix when the user presses Ctrl + n in its current working directory but does not actually update its current working directory to the one of the shell its displaying. This is just wild speculation. Please dismiss it if it doesn't immediately turn out to be true. I have no idea whether this actually is why this weird behavior is happening.
Do you have the option "New window inherits state from active terminal" enabled in the Global options page?
Thank you for this hint! Checking this option removed the weird behavior..
However, I think that this box should be checked by default. If you decide that you don't want this, you should at least remove the confusing behavior and always open a new terminal in the same location if the option isn't checked. For example always open a new terminal in the home directory then.
I agree, I'm not sure why I have it set that way. Let me go back and review the history of it, if nothing obvious leaps out I'll switch it to make it the default.
Thank you! :)
So I had a look at the history, the issue here is that you normally want to two different behaviors depending on where there new window is created. If you create a new window while Tilix is focused (i.e. ctrl+N), you want it to inherit the current CWD. However if you create a new tilix in the shell via the launcher, you want it to open at the home directory. This is the behavior gnome-terminal follows.
The issue in tilix is that I only have one action for both use cases with no differentiation between them. I think the proper way to fix this is to emulate gnome-terminal behavior and remove this option as unneeded. This may require a hidden action to be created at the window level or using a mechanism to determine if a tilix window is currently focused.
@gnunn1 i dont have this option in settings
1.9.1
Same as @Privth, would like to re-open issue.
Most helpful comment
@gnunn1 i dont have this option in settings
1.9.1