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

Hatch shell gets confused after Ctrl-C and jumps between directories #1633

Open
peakschris opened this issue Jul 22, 2024 · 2 comments
Open

Comments

@peakschris
Copy link

peakschris commented Jul 22, 2024

After Ctrl-C'ing out of a hatch cli invoked from within a hatch shell, the shell gets confused and jumps between directories. This is on Windows in a CMD prompt.

Assume:

  • hatch project in d:\hatch\mycli
  • working dir in d:\workspace
cd d:\hatch\mycli
d:\hatch\project>hatch shell
(.hatch) d:\hatch\project>cd d:\workspace
(.hatch) d:\workspace> mycli command
command running...
KeyboardInterrupt
^C
(.hatch) d:\workspace> [press return]
d:\hatch\mycli [press return]
(.hatch) d:\workspace> [press return]
d:\hatch\mycli [press return]
(.hatch) d:\workspace> exit
(.hatch) d:\workspace> [press return]
(.hatch) d:\workspace> [press return]
(.hatch) d:\workspace> exit [window disappears]
@bluss
Copy link

bluss commented Jul 28, 2024

#1647 is similar, but I wasn't sure if it was the same.

@bluss
Copy link

bluss commented Jul 31, 2024

You first have this process tree:

└── command prompt 1
    └── hatch shell
        └── command prompt 2
            └── mycli command

After Ctrl-C I think hatch shell quits, mycli command quits, and the others remain.

You get something like this, hierarchy gone, both prompts connected to standard in/outs:

└── command prompt 1
└── command prompt 2

This is likely something hatch shell could resolve. Either by not reacting to Ctrl-c (let prompt 2 handle it) or when hatch shell dies, make sure to take prompt 2 with 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

2 participants