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

fish: direnv is no longer triggered on shell creation #583

Open
Shados opened this issue Feb 5, 2020 · 2 comments
Open

fish: direnv is no longer triggered on shell creation #583

Shados opened this issue Feb 5, 2020 · 2 comments
Labels
Bug

Comments

@Shados
Copy link

@Shados Shados commented Feb 5, 2020

Describe the bug
direnv does not execute on creation of a new fish shell (or tmux pane or window, etc.) -- I have to hit 'enter' once to trigger it. Triggers fine when changing directories.

To Reproduce
Steps to reproduce the behavior:

  1. bash
  2. cd into a directory with a whitelisted .envrc file
  3. fish

Steps to reproduce the behaviour via tmux:

  1. Use fish
  2. Use tmux, with either of the recommended configurations from the wiki
  3. cd into a directory with a whitelisted .envrc file
  4. Create a new tmux pane or window

Expected behavior
direnv should immediately trigger and load the environment in the new fish shell / tmux pane/window. It does not.

Environment

  • OS: nixos 20.03.git.a21c2fa (Markhor)
  • Shell: fish 3.0.2
  • Direnv version: 2.21.2

Additional context
This issue was essentially caused by #512, which solved a smaller issue (direnv not un/loading when changing directories using alt-left/right), and then later this was not fixed by #549, which solved a larger issue cased by #512 (a general 1-command "lag" on direnv activation when using fish).

Incidentally: that first issue is also back after #549; direnv no longer un/loads when changing directories in fish using alt-left/right. I feel like you need regression tests, although unhelpfully I have no clue how you'd instrument them for something like this :P.

if fish_preexec is the only thing that fires on changing directories with alt-left/right, and fish_prompt is the only thing that fires on creation of a new shell, then it seems like perhaps both need to be hooked?

@Shados Shados added the Bug label Feb 5, 2020
@zimbatm

This comment has been minimized.

Copy link
Member

@zimbatm zimbatm commented Feb 5, 2020

I feel like you need regression tests.

Agreed 1000%. If I was using fish I would have caused these issues. Contributors rarely test out their changes thoroughly which I find disappointing.

@zimbatm

This comment has been minimized.

Copy link
Member

@zimbatm zimbatm commented Feb 5, 2020

I am thinking of using pexpect to drive the shell and write end-to-end integration tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.