8

When I try to open console/terminal in any folder by drop-down menu in the Thunar, the konsole is opened in /home/user folder.

How to configure "Open Terminal Here" shortcut to open new terminal window correctly?

UPD:

  1. Opening the /home/user/Downloads folder
  2. There is folder named "FOLDER"
  3. Right mouse click on folder "FOLDER"
  4. From drop-down menu choosing the "Open Terminal Here" option
  5. New terminal (konsole) is running in the /home/user/ , but should be in /home/user/Downloads
4
  • Xubuntu does not use Konsole, it uses xfce4-terminal. Try with it.
    – GTRONICK
    Mar 10, 2017 at 16:03
  • 1
    @GTRONICK Yes, using the xfce4-terminal it is working fine, but I want to use konsole as default.
    – XuMuK
    Mar 10, 2017 at 16:09
  • 1
    If this is what you want make your question clearer. Mar 10, 2017 at 16:28
  • @JuanAntonio I have a little update about what I am doing and what I am getting.
    – XuMuK
    Mar 13, 2017 at 8:41

4 Answers 4

12

I found solution!!! In Thunar Edit>Configure custom actions... then edit "Open Terminal Here"

and replace:

exo-open --working-directory %f --launch TerminalEmulator

with this:

konsole --workdir %f
0
5

By default, Thunar uses the exo-open command, which is configured in the XFCE settings. If you do not have the XFCE settings app installed, you can instead configure it in ~/.config/xfce4/helpers.rc:

TerminalEmulator=konsole
TerminalEmulatorDismissed=true

or, another example,

TerminalEmulator=kitty
TerminalEmulatorDismissed=true
1

This works when you've selected nothing, folders with blank space, a file, a selection of files, etc.

{ [ -d %f ] && exo-open --working-directory %f --launch TerminalEmulator ; } || { exo-open --working-directory %d --launch TerminalEmulator ; }

Available command parameters in thunar Custom Actions:

List of valid command parameter variables
Variable    Usage
%f  The path of the first selected file.
%F  The paths to all selected files.
%u  The URI of the first selected file (using the file:-URI scheme).
%U  The URIs of all selected files (using the file:-URI scheme).
%d  The directory of the first selected file.
%D  The directories to all selected files.
%n  The name of the first selected file (without the path).
%N  The names of all selected files (without the paths).

The above is equivalent to:


if [[ -d %f ]]; then

    exo-open --working-directory %f --launch TerminalEmulator
else

    exo-open --working-directory %d --launch TerminalEmulator
fi

Or in pseudo-code:

# if the path of the first selected file or directory is a directory
    # open a terminal in the directory of the first file selected
    # or open a terminal in the directory selected
0
1

First run

gedit ~/.config/xfce4/helpers.rc

Now add the following 2 lines to create an alias of your favorite Terminal to be TerminalEmulator. Let's say your terminal is gnome-terminal

TerminalEmulator=gnome-terminal
TerminalEmulatorDismissed=true

Save all changes and exit the file editor. Now go to Thunar: Edit>Configure Costum Actions... and edit the 2 Open terminal Here actions:

  1. First Action

    exo-open --working-directory %f --launch TerminalEmulator

  2. Second Terminal action

    exo-open --working-directory %d --launch TerminalEmulator

Now you can test and enjoy.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .