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

Poetry shell - Problem when erasing accented letters #20

Open
3 tasks done
Biganon opened this issue Nov 5, 2020 · 6 comments
Open
3 tasks done

Poetry shell - Problem when erasing accented letters #20

Biganon opened this issue Nov 5, 2020 · 6 comments

Comments

@Biganon
Copy link

Biganon commented Nov 5, 2020

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • Archlinux, 5.9.3-arch1-1
  • Poetry 1.1.4
  • termite v15
  • zsh 5.8
  • No dependencies whatsoever

Issue

Hi,

I create this very simple test script:

print("Enter something: ", end="")
text = input()
print(text)

When I run it from my normal shell (zsh 5.8) I can type "ééé", and then erase those three characters, end of the story.

When I run it from inside poetry shell, I can type "ééé", and then I can erase all the way to the "g" at the end of something, including it. So I can "erode" the prompt, so it looks like "Enter somethin". If I now type something, with or without accents, it will be written right after "somethin", and it will be correctly registered and printed to me. So I can read "Enter somethinhello", hit Enter, and "hello" gets printed on the next line.

The number of prompt characters I can erase depends on the number of accented letters I've entered first. If I enter four of them, such as "éééé", I can erase one character further, until it reads "Enter somethi".

@sinoroc
Copy link

sinoroc commented Nov 5, 2020

I can recreate the issue with:

  • Ubuntu 18.04
  • Gnome Terminal 3.28.2
  • bash 4.4.20
  • Poetry 1.1.4

@finswimmer
Copy link
Member

finswimmer commented Nov 9, 2020

I have no solution for you, but I'm fascinated by this problem :) Most probably it's in encoding problem. But why does this happen only in a shell created by poetry? 🤔

@sinoroc
Copy link

sinoroc commented Nov 9, 2020

@finswimmer No clue either. Shells/terminals are quite tricky to tame. Did you manage to recreate the issue?

@finswimmer
Copy link
Member

Yes, I'm able to reproduce it, if I start the script with poetry run ... or run poetry shell first. But I'm not able if I activate the venv with source .venv/bin/activate. So it has something to do how the shell is created.

@dimbleby
Copy link

this looks like a pexpect problem, maybe the same as pexpect/pexpect#689

As there, you can recreate the issue inside the shell obtained through

python -c "import pexpect; c = pexpect.spawn('/bin/bash'); c.interact(); c.close()"

@dimbleby
Copy link

cf #18

@Secrus Secrus transferred this issue from python-poetry/poetry Oct 14, 2024
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

4 participants