devenv icon indicating copy to clipboard operation
devenv copied to clipboard

Weird terminal in VSCode when using default devenv setup (with direnv)

Open normanjaeckel opened this issue 11 months ago • 1 comments

Describe the bug

I get a weird terminal if using devenv with direnv in VSCode.

Bildschirmfoto vom 2024-03-23 17-59-58

Do you see this \[\]?

The problem is that VSCode detects a somehow custom bash instead of /usr/bin/bash. It uses /nix/store/4vzal97iq3dmrgycj8r0gflrh51p8w1s-bash-5.2p26/bin/bash

Bildschirmfoto vom 2024-03-23 18-01-13

I know that this is the expected behavior of VSCode. I use the default settings, that VSCode looks for the next available bash.

My problem is: Why does the default devenv setup modify this bash although my setup does not contain any instructions to do this? I am using just the default devenv.nix from a fresh devenv init.

What is the difference between /nix/store/4vzal97iq3dmrgycj8r0gflrh51p8w1s-bash-5.2p26 and the common bash installation.

I am using Arch Linux with up-to-date package and I think this should be the same as the used nix package.

$ pacman -Q bash
bash 5.2.026-2

Do I have to install another Nix package like bashInteractive or is this a bug of devenv that it enforces a specific (and maybe bad) bash installation/version?

To reproduce

See https://github.com/normanjaeckel/roc-with-devenv/tree/e5ed8f025b8df93fab4b8f9ad99f159071c24200. If you open VSCode in this simple example project (direnv allow must be called before opening VSCode) you see this bug.

Version

1.0.1

direnv profile: https://gist.github.com/normanjaeckel/5e1dd2d189b09e9f60bde030ca5eecc8

normanjaeckel avatar Mar 23 '24 17:03 normanjaeckel

I've seen that too, I suggest not using direnv for entering VSCode, but rather using direnv plugin inside VSCode to activate the environment.

I'd love to see this fixed though, I have no idea how.

domenkozar avatar Mar 25 '24 06:03 domenkozar