Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spawning a new shell with "pew workon" #241

Open
skepppy opened this issue Jul 4, 2024 · 0 comments
Open

Spawning a new shell with "pew workon" #241

skepppy opened this issue Jul 4, 2024 · 0 comments

Comments

@skepppy
Copy link

skepppy commented Jul 4, 2024

When running pew workon some-env a new shell is spawned. workon_cmd() retrieves a potential project directory and eventually runs a configured shell with specific environment variables (cmiiw). This has a couple of consequences and I was wondering why a new shell is spawned versus "just" setting the environment variables and setting the possible current working directory.

Two points that are less ideal imo when spawning a shell when running pew workon some-env:

  • In my case, the Bash history of the shell session that executed pew workon some-env is not available, because the new shell reads the ~/.bash_history, which has not yet been updated. This means I cannot do the following: (1) run a command, seeing that I need to set my specific virtual environment, (2) running pew workon some-env, and (3) doing ArrowUp + Enter to invoke the previous command from step (1), since those commands are not yet written
  • When running pew workon in the same session multiple times, you will have nested shells that you have to remember, but maybe certain people prefer this method

What do you think about this? Would merely changing the directory + setting the environment variables also work, and if not, what are the downsides of it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant