nix-env-selector icon indicating copy to clipboard operation
nix-env-selector copied to clipboard

Terminal running in environment

Open jamievicary opened this issue 3 years ago • 5 comments

I've got this working, but when I want to build manually I still need to write "nix-shell" in the terminal by hand, it seems. Could this not be done automatically by the extension?

jamievicary avatar Aug 13 '20 13:08 jamievicary

This should rather be an option, as sometime you want to get out of the nix-shell to edit it and debug it.

GuillaumeDesforges avatar Nov 06 '20 11:11 GuillaumeDesforges

An idea, document the behavior. I'm rather new to nix pkgs. My first thought that the extension was broken since the packages weren't available in the terminal.

rvanlaar avatar Jun 26 '21 16:06 rvanlaar

Please correct me if I'm wrong, but a workaround could be to set up direnv in the project folder. That way, every time one enters the project directory via the VS Code terminal, nix-shell is started. At least it seems to be working for me.

PBHDK avatar Jul 23 '21 14:07 PBHDK

Another simple solution I found is to add a custom terminal profile. Here's an example you can drop into your code-workspace config:

{
	"settings": {
		"terminal.integrated.profiles.linux": {
			"Nix Shell": {
				"path": "nix-shell",
				"icon": "terminal-linux",
			},
		},
		"terminal.integrated.defaultProfile.linux": "Nix Shell"
	}
}

There is that couple second delay when you open a window from running nix-shell but it's not nearly as bad as waiting for it to open then running nix-shell yourself :)

m1cr0man avatar Dec 22 '21 17:12 m1cr0man

this is a good workaround for now, but I think it would still be good for the plugin to somehow include this functionality

Kruemmelspalter avatar Sep 10 '22 17:09 Kruemmelspalter