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
XuMuK
  • 375
  • 2
  • 4
  • 17

4 Answers4

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
XuMuK
  • 375
  • 2
  • 4
  • 17
4

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
flaviut
  • 153
  • 5
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
sickcodes
  • 11
  • 2
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.

  • 1
    This is the answer that was already given and accepted. You are just repeating what was already said. – David Apr 09 '23 at 06:37
  • I know what i do bro. All those answers are partial. For me, i wrote this one for the next generations. They will see my comment and they will not spend more time on researches – King Saozer Apr 14 '23 at 21:05