Indent behaviour on paste is different in terminal and AWS CloudShell

Offen
#1,908 1 Kommentar 3 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
python
Bereich
cli

Rechercherichtung

Reproduce the multiline paste behavior in AWS CloudShell and in the other terminals described in the report. Then trace prompt-toolkit's multiline input and paste handling to determine why indentation differs; done means the behavior is corrected or a documented way to control auto-indent is provided.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Hello,

I notice a difference in behavior of following code in terminal win/macos/linux vs AWS CloudShell.

from prompt_toolkit import prompt
answer = prompt( "Multiline input: >\", multiline=True)
print(answer)

In AWS CloudShell the text pasted is
image

In other terminals paste works as expected
image

As per doc multi-line activates indent mode and it works fine. But on AWS CloudShell paste works combined with indent but with other terminals it works some other way not indenting the pasted input.

Most likely prompt-toolkit detects paste action but in AWS CloudShell the paste mechanism is not detectable(?).

Is there a way to deactivate auto indent on multi-line mode any other way to make paste work on AWS CloudShell ?

Vorherrschende Sprache
Python
Sterne
10.6k
Forks
815
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus prompt-toolkit/python-prompt-toolkit

Alle Issues in prompt-toolkit/python-prompt-toolkit

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.