Skip to content

Set working directory if "Open Terminal" is selected from that directory's context menu

This MR changes the behavior of the "Open Terminal" action when right-clicking on a directory.

Currently, if you select a directory, right-click on it and then click on "Open Terminal", the window's current directory (NOT the selected directory) is opened in the terminal. Strangely, the same thing also happens if you select more than one directory (I would have expected no "Open Terminal" at all).

This patch changes the behavior as follows:

  • If you right click on nothing, "Open Terminal" will behave as it did before (i.e. it will open the window's current directory)
  • If you right click on a directory, "Open Terminal" will open that directory
  • If you select more than one directory and right-click, the "Open Terminal" action will not be available at all

I am not fully convinced of the approach that I used to clone the appearance of the window's "Open Terminal" action. A simpler alternative could be to explicitly hardcode the text and the icon name, like in dolphinmainwindow.cpp

Merge request reports