-
-
Notifications
You must be signed in to change notification settings - Fork 835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dolphin: Open in terminal should open the current directory. #2103
Comments
Are you using the Nautilus extension? If so, that should already be setting the cwd. @lunaryorn, can you offer some guidance on how to debug this? |
I am using dolphin, I think the issue stems from wezterm not opening in the directory it's being called from. say you desend into into another directoy most terminals if you launch them via another terminal emulator from that directory will open in said directory. Ie in konsole, if I launch I believe this is how most things implement various "open terminal here" functionality |
I see. wezterm chooses the home dir by default (actual logic is shown here: https://wezfurlong.org/wezterm/config/lua/config/default_cwd.html) for consistency across platforms, as some GUI environments will spawn the terminal with a surprising and undesirable location by default. In the Nautilus integration, it knows to tell wezterm to use a specific directory. |
This is also happening in thunar 4.16.8 (XFCE). |
Thanks to @Anomalocaridid, this should be fixed now in It typically takes about an hour before fixes are available as nightly builds for all platforms. Linux builds are the fastest to build and are often available within about 20 minutes. Windows and macOS builds take a bit longer. Please take a few moments to try out the fix and let me know how that works out. You can find the nightly downloads for your system in the wezterm installation docs. If you prefer to use packages provided by your distribution or package manager of choice and don't want to replace that with a nightly download, keep in mind that you can download portable packages (eg: a If you are eager and can build from source then you may be able to try this out more quickly. |
I tried it with Thunar (XFCE) and I didn't see any change, but I don't know if I'm testing it correctly or if the fix doesn't apply to XFCE. |
@reidrac I was only able to replicate the problem in Dolphin on my system. When I tried it with Thunar on my system it wouldn't even open a terminal. Although I should note that I use Sway, not XFCE, so that could be part of it. |
@wez Im not sure if that fix will work across the board, as some apps will open terminal using the .desktop, but some will open it by simply executing the binary. It would be nice to have the option to have that behavior when executing the binary directly. at the very least as something we can enable in config files. However as the original issue was solved, I can either close this issue, or change the title of it if you wish |
I believe this is the case for XFCE. |
@reidrac do you know how whichever app you're using under XFCE figures out that wezterm is even a thing it could run? If you want to override behavior in your config file, then you could do something like this (nightly build required): EDIT: this doesn't apply in all cases, instead, see: #2103 (comment) local wezterm = require 'wezterm'
local mux = wezterm.mux
wezterm.on('gui-startup', function(cmd)
-- allow `wezterm start -- something` to affect what we spawn
-- in our initial window. If they didn't specify it, use a default empty SpawnCommand.
local cmd = cmd or {}
-- I prefer to use the cwd of the gui process instead of (probably) the home dir
if not cmd.cwd then
cmd.cwd = wezterm.procinfo.current_working_dir_for_pid(wezterm.procinfo.pid())
end
mux.spawn_window(cmd)
end)
return {} |
Just tested this, it works when launching via terminal and dolphin (after reverting the desktop file fix too) but only on the first window spawned, any additional windows spawned after will default to the old cwd |
Did you install wezterm from the .deb package? |
The .deb package registers that script as the alternative for a terminal emulator in the hope that various "open terminal here..." functions in other tools will use that to detect wezterm and run thing in the cwd. refs: #2103
@wez it is a GUI option in settings, you can select any binary you want, will run with a parameter when something needs to be opened with the terminal; see: https://docs.xfce.org/xfce/exo/4.16/preferred-applications#utilities I'm using |
so that it will work for locations that have spaces in their names. refs: #2103
OK, so my recommendation for this is for folks to use the new https://github.com/wez/wezterm/blob/main/assets/open-wezterm-here The .deb packages register that script as the x-terminal-emulator alternative. |
I think the problem still exists,I'm using When I open wezterm via context menu in dolphin, it looks ok, But if I don't close this terminal, and open a terminal in another directory in dolphin, The new terminal is still started in the previous directory. Is this problem not solved? or do I need to config something else? Looking forward to your reply. |
I wrote a menu for dolphin to solve this problem. |
@ambition-echo are you using the |
Sorry, I don't konw what is this |
@ambition-echo as mentioned above: #2103 (comment) |
Ok, I see it, but I don't think this script is useful, because it is not integrated in the file manager. |
Yes, If add it in the main .desktop, That will add an option to the right-click menu of the taskbar icon in wezterm. |
Maybe you can put this desktop file in |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Is your feature request related to a problem? Please describe.
In Linux and windows, you can use a context menu to open terminals from inside file managers. on desktops etc. it would be nice to have this functionality work in wezterm.
Describe the solution you'd like
current behavior just opens wezterm as if it was opened normally, instead of opening at the location specified by the menu
The text was updated successfully, but these errors were encountered: