Konsole -> right click -> "open with" feature doesn't work

Hi all,

with open suse i used to open folders with right click > open with dolphin or just right click > open with visual studio code the entire folder, i wonder why it doesn’t work here in manjaro. I’m on kde version and if try to open up with visual studio code i can see the application on the application bar trying to open, it shows a spinner but it doesn’t open up.

I tried to search here on the topics and on google but i can’t figure it out.

If you can’t open folders with Visual Studio Code in Manjaro KDE, check your default applications in system settings. Ensure Visual Studio Code is set as the default for folders. If issues persist, try launching it from the terminal using the code command to uncover any error messages.

This is very confusing… not helped by the complete absense of Captial Letters and/or punctuation.

From your title, it would appear you are trying to do this with Konsole - which would never work.

If you’re trying this In Dolphin, you can use the context menu to ‘open with…’ and if ‘Code’ isn’t visible there, this also works with my current favourite - Kate.

If you’re getting a spinner, then there’s a problem with your installation of visual studio code. We have it listed in the repositories as ‘code’ and so you could just try launching it from your terminal.

The best solution for this might be to check what you installed - the repositories have it listed as ‘code’ and so you can do it simply by opening Konsole (not Dolphin - but if you do it in Dolphin press F4 first to get the terminal)

code - paste the output here…

or perhaps pamac install code and see what output you get.

1 Like

In the future, be more specific: how to get to the default supplications, how to ensure VS Code is the default, and how the OP should post their results…

Thank you for your help!

The usual desktop file for visual studio code contains an option to handle folders but for some reason using this option makes all folders open in Visual Studio Code.

I don’t think this option is a part of the desktop file installed with code package.

You will have to use one of the custom packages found in AUR to get this functionality

Rightclick on any folder then select Open folder withOther Application → point to the Visual Studio Code application.

Note that I’m using using Code - OSS but it should be the same.

Right-click folder in Dolphin, Open Folder With → Other Application…, choose Code - OSS, it works.

To add Code - OSS (or any other application) as an option for opening folders in the right-click menu, so that you don’t have to go through the Other Application… dialog;

  • System Settings → Applications → File Associations

  • In Known Types go to inode → directory and add the application

  • Move it down below Dolphin in the list

In VSCode, you might need to manually configure related items under:

PreferencesWindowNew Window (or similar).

Note this is only a guess; it works as expected here. Cheers.

Well, now that the OP has changed the title and clarified their topic to some extent further in the thread, this response is clearly of no use.

Did the original title get changed? I thought the original question was specifically about using a mouse right-click in the Konsole terminal emulator to open a contextual menu, and then selecting Open Folder With > Dolphin. This should open a Dolphin window whose location is Konsole’s current working directory. This works just fine for me, and I do not believe I have made any modifications to the settings to specifically allow this behavior.

If this is indeed the OP’s problem, then I think he/we should focus on the simpler Dolphin issue, and leave the (likely related, but possibly more complicated) VS Code issue for later.

Also works for me, and so does open current Konsole folder with Code - OSS or Kate or Filelight or Gwenview or whatever.

More steps are needed to keep it in the list… as Code might not be listed as an option to open with…

  1. Right click, then go to keyboard, press ‘o’ twice (Open with… Other application).

  2. Type ‘code’ and select (in my case ‘Code - OSS’ shows up under Development and Utilities - same thing)

  3. Press Alt+R (or click to ‘Remember’ to keep it in the list of options).

  4. Right click > Properties - and where you see ‘Open With…’ select ‘Change’ where you can take it down from the TOP of the list - so your folders will still choose Dolphin to open by default.

1 Like

My bad guys i really wrote this topic badly.

what i meant is that i couldn’t right click on the console and open a folder with VSC anymore as i used to

I takes a little effort …

Summary

image

Same issue here - the right-click menu appears in Konsole (using zsh), but nothing happens when a choice is clicked on.

i click on that vsc it seems to launch, i get a spinner but nothing happens then

Same here.

With my zsh profile nothing happens, bash profile works.

It works with bash, but not with zsh, please report it to https://bugs.kde.org.

If you want a workaround for zsh, simply enable thumbnails in Konsole preferences

Then enable underline files in your current profile

Then in Konsole move your mouse pointer to current displayed folder path until it became underlined then right click on it

Can confirm. I was testing with bash because that’s what I use, switched to zsh and right-click → open with no longer works at all.

I just opened Konsole - maybe the settings need checking thoroughly.

Here with FISH:


and the same results with ZSH and BASH too.

So I’m very curious why other people aren’t getting the same results.

This isn’t from a context menu, the context menu opens the current path of Konsole - this is by hovering and getting the item underlined, then just left clicking to open - but there’s also the context menu which I also tested, and which will also open with Kate and Code.

Relevant settings: (`Ctrl + Shift + , )

Profiles>

  • Independent profile settings, so click to select your current profile:
    2023-12-15 08:34:08

  • Mouse>Misc: Select to Underline links/files and :heavy_check_mark: Open files/links by direct click.

But I fail to see why this would vary between Bash/Zsh/Fish - the Konsole context menu is perfectly consistent here.

Hack fix borrowed from fix(termsupport): add workaround for directory tracking issues in Kon… · ohmyzsh/ohmyzsh@8428442 · GitHub

Add the lines below to the end of your ~/.zshrc. It’s just replacing the mzc_termsupport_cwd function from /usr/share/zsh/manjaro-zsh-config.

Might also want to report it upstream. Related - 468745 – Konsole Context Menu: Open File Manager Option Fails to Open

function mzc_termsupport_cwd {
  # Percent-encode the host and path names.
  local URL_HOST URL_PATH
  URL_HOST="$(zsh_urlencode -P $HOST)" || return 1
  URL_PATH="$(zsh_urlencode -P $PWD)" || return 1

  [[ -z "$KONSOLE_PROFILE_NAME" && -z "$KONSOLE_DBUS_SESSION"  ]] || URL_HOST=""

  # common control sequence (OSC 7) to set current host and path
  printf "\e]7;file://%s%s\e\\" "${URL_HOST}" "${URL_PATH}"
}
1 Like

When using manjaro-zsh-profile the right click doesn’t work the same way.

You only get an Open with on right click.

When you replace manjaro-zsh-profile with e.g. grml-zsh-config the context right click shows a menu with application options.

That is why we are all getting different results.

The issue seems related to Packages / Community / manjaro-zsh-config · GitLab

@Chrysostomus is the author and the source is at GitHub - Chrysostomus/manjaro-zsh-config: Zsh configuration package for manjaro

1 Like