Workaround for 'poetry shell' breaking shell integration #8769
MajorDallas
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I don't think this is a bug in either kitty (0.32.2) or Poetry (v1.6.1), just one of those things where two bits of software don't play nicely together.
This started when I enabled
shell_integration
for the first time. I maintain several Python projects that use Poetry, and I pretty much always start the day withcd the_project; poetry shell
. With kitty's shell integration, I started getting this error after every command:Mostly, it's just terminal spam--nothing bad happens. However, I observed that the
scroll_to_prompt
andshow_last_command_output
actions didn't work right.scroll_to_prompt -1
would always take me back to thepoetry shell
line, andshow_last_command_output
showed everything since that command.After some more reading of kitty's docs, I changed the invocation to
kitten run-shell --shell='poetry shell'
This helps. The 'command not found' error still prints every time, but
show_last_command_output
now shows the last command's output as expected.scroll_to_prompt -1
still goes all the way back topoetry shell
, though. I suspect Poetry's use of the Pexpect library is what's causing the trouble, but I'm not particularly interested in finding out right now.Yet more reading of the docs prompted me to try manually enabling shell integration after starting
poetry shell
. That finally gotscroll_to_prompt -1
working as expected, also.In the end, to make shell integration work with
poetry shell
(and possibly any other Pexpect-managed shell environments? or any interactive subshell?):This all might be irrelevant to people who actually keep Poetry up to date, since it now has the
poetry env activate
command that seems to work more like a traditional venv? Anyway, wanted to share in case anyone else runs into a similar issue.Beta Was this translation helpful? Give feedback.
All reactions