Nautilus "Open in Terminal" option still not showing for Ptyxis; no default terminal app setting

If I uninstall gnome-console/kgx, and gnome-terminal, but install ptyxis, the “Open in Terminal” option disappears from Nautilus. gnome-terminal is a different GTK version, so it visually clashes with the desktop window style, unlike kgx/gnome-console. However, gnome-console/kgx doesn’t seem to allow for color configuration, unlike ptyxis. However, ptyxis, unlike kgx/gnome-console and gnome-terminal, doesn’t show as an option with nautilus. It just seems like, no matter which terminal I pick, I can’t “win”. If I go to Settings > Apps > Default Apps, there is no setting for a default terminal. And it is also known that Gnome-terminal or nautilus disrespects xdg-terminal-exec . Shoudn’t either:

  1. gnome-console/kgx support color changes in the GUI;
  2. kgx/gnome-console support color changes in a configuration file that is widely known and documented;
  3. gnome-terminal be ported to GTK4;
  4. ptyxis be automatically added to whatever code or configuration makes terminals show in the nautilus drop-down menu;
  5. there be a default terminal app option in settings.
  1. Only support for Console is built-in to Nautilus currently. Other terminals install their own Nautilus extension that adds them to the context menu. That’s what Gnome Terminal does.
  2. xdg-terminal-exec would do that, and was worked on for Nautilus Add xdg-terminal-exec integration (!1781) · Merge requests · GNOME / Files · GitLab , but as you can read in the comments there xdg-terminal-exec was a stop-gap solution and XDG Intents is instead what will fill this need. A recent update talks also about how it works for terminals and which GNOME components already support it: XDG Intents Updates

I prefer Ptyxis and same as you removed Console and Gnome Terminal. My solution was to write a short Nautilus extension that adds “Open in Ptyxis” to the context menu: jakedane/nautilus-ptyxis: Nautilus extension to open directories in Ptyxis - Codeberg.org. It should be easy to compile, at least it is on Arch Linux. Compiling on other distros may require changes to the build command.

It looks like (terminal) applications that want to integrate with Nautilus must provide an integration script. Ghostty and Wezterm provide a Python script, which is copied to the extensions folder of the nautilus-python package.

I can’t see anything like this in the Ptyxis project. Maybe that’s the missing link?

See also @jakedane’s explanations above.

A Nautilus extension is what is needed, that doesn’t need to be a Python script. nautilus-pythonis only needed for Nautilus extensions written in Python.

Thank you both of you. Your replies are very Informative. It is definitely not scalable to expect each terminal developer to write an extension for each file manager. An extension specific to both file manager and terminal is also not ideal, especially if it is not distributed directly by GNOME, or my distribution’s usual channels, such as the official Arch Linux stable or testing repositories (or the AUR). It should also come with Ptyxis or with GNOME Files, and not need to be installed separately by a confused user after searching the web for it.

The extension works, which is pleasing. I hope to someday find it in the AUR, or integrated into Ptyxis or nautilus. But I would suggest first achieving parity with the existing functionality, including relocating it in the first section of the menu rather than the third, and introducing a keyboard shortcut combining Ctrl with some other key, such as Ctrl+;

EDIT: My problem is temporarily resolved to my satisfaction, but long-term steps would include improvements to the extension and integration into existing software distribution methods. An ideal solution would also be terminal-agnostic. I should be able to switch terminals and still use “Open in Terminal”. There should be a visual selection for default terminal like there are for other apps. Is there a way I should be testing this “XDG” stuff? Last time I tried, nautilus clobbered my attempts at configuring XDG correctly. Is that fixed yet? Should I try again? Also, yes, I have “Console” installed again for comparison in that screenshot.

1 Like

I fully agree. It’s cumbersome to let every terminal application implement their custom plugin. But that avoids conflicts, I guess. Just in case people want to run several terminal apps in parallel. :roll_eyes:

Some digging in the Nautilus source code reveals that the GNOME Console application is literally hardcoded via its app-id org.gnome.Console in nautilus-dbus-launcher.c. There’s likely no clean way to swap the application for a custom one. Unfortunately, the XDG Specifications don’t provide a generic means of invoking a system’s (default) terminal app either. :confused:

Looks like we’re stuck with external plugins.

Extensions that add an item to the context menu are all placed near the bottom, that’s not changeable by the extension. Console was higher up the context menu because it’s not created by an extension but by Nautilus itself. Extensions can’t add keyboard shortcuts either. The Ctrl+. keyboard shortcut in Nautilus to open the current directory in Console is also built into Nautilus.

I haven’t yet figured out how to contribute to the AUR without it publishing my private email address. But if you prefer the AUR there are several other Nautilus extensions in there which can do the same thing. Some I tried didn’t work with Ptyxis, and the ones which worked with Ptyxis are Python scripts — which requires nautilus-python, which is a security risk and hence I wrote my own.

As for a better way, that’s what the XDG Intents specification is for. It allows for apps to specify in their .desktop file which “intents” they support and for users to specify which of the apps that support a certain intent to use by default for that intent. So terminal apps can say they support the intent to run a command or a shell in a terminal, and the user can say which terminal to use by default. It that all gets implemented, and Nautilus supports it as well, where now Nautilus has hardcoded to use Console it would instead use the user’s preferred terminal. From the blog post I linked to with the recent update about the work on XDG Intents, Ptyxis already supports it.

From the user perspective, I would say this seems biased, opinionated, or reductive of user choices.

I recommend using an email mask. Enter “mozmail” into your search engine. I have seen such AUR extensions recommended before but I have found that the code looked very sloppy, even to a complete newbie such as myself.

Is there a way for me to make nautilus work with intents? I am willing to attempt to apply a patch or use a development version if such a thing exists. If there is another file manager that supports intents I would be curious to try, but it sounds like a work-in-progress specification. I don’t know if I will be successful, though, given my lack of experience. Is intents something I would have to install, or just a new standard that will eventually be applied to nautilus or… I already have some xdg-desktop-* packages installed.

The XDG Intents specification is under development. It’s not supported by apps yet.

1 Like

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.