files icon indicating copy to clipboard operation
files copied to clipboard

Opening Files via the keyboard shortcut always opens a new tab

Open TomiOhl opened this issue 1 year ago • 6 comments

What Happened?

When I open Files via a keyboard shortcut (Super+E for me, not sure if that's the default or I've changed it), it always opens my home folder on a new tab, even if it's opened on an other tab. Related: if Files is already open and I use the keyboard shortcut, it doesn't only bring it into focus, but also opens a new tab.

Steps to Reproduce

  1. Open Files via a keyboard shortcut
  2. Close Files
  3. Open it again via a keyboard shortcut

Expected Behavior

The keyboard shortcut should simply open the application (or bring it into focus if it's already open). It shouldn't open a new tab, especially if there is already one (or more).

OS Version

7.x (Horus)

Software Version

Latest release (I have run all updates)

Log Output

No response

Hardware Info

No response

TomiOhl avatar Aug 29 '23 11:08 TomiOhl

This looks like a duplicate of https://github.com/elementary/switchboard-plug-keyboard/issues/74.

You need to add a custom shortcut io.elementary.files and assign shortcut. After that it should work as expected.

lenemter avatar Aug 29 '23 12:08 lenemter

Partially maybe but not entirely. It definitely didn't work like this before the latest update. Previously it didn't open another new tab if one was already open. Right now if I use the shortcut I always end up with at least two home folder tabs.

TomiOhl avatar Aug 29 '23 12:08 TomiOhl

May be related to https://github.com/elementary/files/pull/2272. Not sure which, if any, option is used when opening Files from the system system shortcut. However, you do not get the extra tab if opening from the commandline which is odd. Will investigate. A similar issue is being fixed in Terminal

jeremypw avatar Aug 29 '23 14:08 jeremypw

You only get an extra tab from the commandline if you actually give a URI with the -t option which is what I would expect.

jeremypw avatar Aug 29 '23 14:08 jeremypw

If you create a custom shortcut for opening Files with the command io.elementary.files then there is no extra tab. I think the issue is related to the fact that the shortcut is for opening Files at the Home Folder which probaby uses the command io.elementary.files -t ~ (need to check). This forces the creation of a new tab at the Home Folder.

jeremypw avatar Aug 29 '23 15:08 jeremypw

We need to do like Terminal and have a command that does not create a duplicate tab if the requested (Home) folder is already restored.

jeremypw avatar Aug 29 '23 15:08 jeremypw