Stunkymonkey / nautilus-open-any-terminal

GNU General Public License v3.0
608 stars 64 forks source link

Duplicate Terminal in Default Option and List of Terminals #85

Closed tnowad closed 1 year ago

tnowad commented 1 year ago

Issue Description: I have noticed a potential issue with the Nautilus Open Any Terminal extension regarding the default terminal option and the list of terminals. Currently, there seems to be a duplication of the default terminal in the list of terminals, and I believe it would be beneficial to address this issue.

Steps to Reproduce:

  1. Set the default terminal using the following command in the terminal:
    gsettings set com.github.stunkymonkey.nautilus-open-any-terminal terminal <terminal>

    Replace <terminal> with the desired terminal emulator (e.g., wezterm, xfce4-terminal, etc.).

  2. Open Nautilus file manager.
  3. Right-click on any directory to bring up the context menu.

Expected Behavior: The "Open in Terminal" option should provide a single default terminal in the list of terminals, or remove it if the default terminal is empty.

Actual Behavior: The "Open in Terminal" option displays a duplicate entry for the default terminal in the list of terminals.

Proposed Solution:

Thank you for your attention to this matter. If you require any further information or clarification, please let me know.

Stunkymonkey commented 1 year ago

how did you install the plugin? might be that you installed it system-wide and user-wide. This way two entries are shown.

tnowad commented 1 year ago

@Stunkymonkey

Thank you for your response and suggestion regarding the Nautilus Open Any Terminal extension.

To address your question about how I installed the plugin, I used the package manager 'paru', which is similar to 'yay'. I installed the following packages: wezterm, gnome-terminal, and nautilus-open-any-terminal.

In the default configuration, where no specific default terminal is set, the behavior of the "Open in Terminal" option in Nautilus is as follows:

Here is an image illustrating the default configuration: Default Configuration

Alternatively, if I specifically set WezTerm as the default terminal using the gsettings command you mentioned, the behavior is modified as follows:

Here is an image illustrating the configuration with WezTerm as the default: Configuration with WezTerm

Based on these observations, it seems that the duplication issue you mentioned does not occur when using the default configuration. However, it does arise when a specific default terminal is set.

To address this issue, one potential solution could be to modify the extension's logic to exclude the default terminal from the list of selectable terminals if it matches any other terminal in the list. Additionally, if the default terminal is empty, it could be omitted from the list as well. These modifications would help ensure that only distinct terminals are displayed in the options.

Thank you once again for bringing this issue to our attention. If you have any further questions or require additional information, please let me know.

Stunkymonkey commented 1 year ago

ok good. I think I got the problem:

So it might be that the other context-entries were already installed a long time ago. By installing my plugin you simply installed the dependency nautilus-python and thereby the context entries are shown.

So my suggestion: uninstall this plugin, but keep the dependencies installed (, reboot) and have a look at it again.