VSCode start: shell environment error and X11 clipboard goes dead

Hello,

Using Fedora 35 with all current updates installed. Using X11 with accessibility turned on (Orca master screenreader). This update was pulled in a few minutes ago, but did not fix the issue:

xorg-x11-server-Xorg.x86_64   1.20.14-1.fc35    @updates               

Since today, the common practice of Ctrl+C (copy to clipboard) and Ctrl+V (paste from clipboard) does no longer work reliably. Some of the time, I can choose Copy from the Gedit or terminal context menu. But then, pasting only works when using the mouseā€™s middle click.

I know about the existence of several different X-clipboards, but really would like to restore the default behavior of a single, simple, ā€˜regularā€™ clipboard. I am very used to it, that way.

Can someone help me?

Thanks,
Frans-Willem

1 Like

What desktop environment are you using?

In the terminal you have to hold shift as well (Ctrl+Shift+C for copy, Ctrl+Shift+V for paste). Are you experiencing the issue outside of the terminal?

Thanks for responding so quickly.

Some more info:

  • Iā€™m using GNOME 41 as my desktop environment under X11
  • running kernel 5.15.8-200.fc35 (was pulled in yesterday, but did not fix the issue)
  • have tried booting both 5.15.7-200.fc35 and 5.15.6-200.fc35; the issue persists

After fresh reboot, Ctrl+C and Ctrl+V work inside a Gedit text window, or even in the Alt+F2 run-dialog.

As soon as I start Visual Studio Code (updated to v1.63.2 yesterday), the copy-and-pasting ceases to function properly. At this moment, Iā€™m only able to copy-and-paste (in both Gedit and Terminal) using mouse-select, right-click-menu, Copy, then middle-click to paste.

I will have a try rebooting and switching Orca off - see if that helpsā€¦

UPDATE: the issue appears as soon as (and only when) I start Visual Studio Code. It doesnā€™t matter whether I enable the Orca screenreader or not. Since yesterday, VSCode gives me this error:

Unable to resolve your shell environment in a reasonable time.
Please review your shell configuration.

Is this perhaps related to my clipboard-issue? I really would like to keep using VSCode as my IDE. What can I do to fix this?

Thanks and kind regards,
Frans-Willem

Hi, from where are you install VSCode? My suggestion is try VSCode flatpak version. With flatpak, my understanding, it will used flatpak version of Gnome environment (container). I believe it will prevent incompatibilities with your core system configuration.

Thanks for your response.

I have removed the RPM version of VSCode and installed the Flatpak version, as you suggested.
Yes, the clipboard now works as expected. But the sandbox-environment the IDE runs in is far from ideal.

All my personal settings have to be imported and re-tweaked. VSCode complains about being unable to validate the path to the PHP executable (which is understandable, as itā€™s running in a container and canā€™t directly reach the host).

Rather than reinventing the wheel (by getting the Flatpak VSCode running smoothly), I would prefer to actually solve the problem in my ā€˜regularā€™ environment.

Any other thoughts, perhaps?

Thanks!
Frans-Willem

UPDATE:
I just re-installed VSCode via RPM. When I start it using the desktop shortcut, the Shell-error appears and the clipboard goes dead.

However, when I navigate to my project folder and start VSCode like this:

code .

no error appears and the clipboard stays intact!

Can someone explain this behavior?

Thanks!
Frans-Willem

Base on Visual Studio Code Frequently Asked Questions, maybe you could try to comment out or remove first your custom setup in .bashrc or others related to your custom environment setting.

Thanks, I tried those suggestions right away, after I first saw the error message in VSCode. Even completely emptying ~/.bashrc and ~/.bash_aliases didnā€™t help. I have no nvm installed.

How can I investigate this further? Which files does VSCode process upon startup, or rather upon opening a file to be edited?

Thanks,
Frans-Willem

Are you using any gnome extensions?

Are you using zsh or fish?

If there are variables in your bashrc that need to be set for vscode, you may want to move them bash_profile.

I remembered something. If youā€™re on VSCode, usually we can use some short cut key and VSCode will stated something like "waiting for other keyā€. Please check if cmd+cor cmd+v key combination have a key binding assigned in your VSCode.

Yes: AppIndicator and KStatusNotifierItem Support by 3v1n0
Yes: Dash to Dock by michele_g

No, plain and simple Bash.

There are no VSCode-specific variables set in my ~/.bashrc.

I did make a setting in /etc/sysctl.conf: fs.inotify.max_user_watches=524288, as described in VSCodeā€™s FAQ.

There are no conflicting key-combos defined.

Any other thoughts?

Thanks,
Frans-Willem

~/.bash_profile! Thatā€™s it!

I recently added my Braille input enabling command xbrlapi -d:0to this file.
Not realizing that VSCode would execute it, too. Dā€™oh!

Case solved. I will put the Braille command somewhere else; perhaps in its own .desktop-file in my ~/.config/autostart/ folder.

Thanks all!

Kind regards,
Frans-Willem

1 Like