`Pane.send_keys` types nothing and raises nothing for text that starts with `-`
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 82/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- python
- Domaine
- backend-api-design, cli
Piste de recherche
Lis src/libtmux/pane.py autour de la construction de argv de Pane.send_keys à la ligne 847 et vérifie comment Pane.cmd traite les arguments de tmux. Reproduis le cas avec l’entrée fournie -n hello, puis vérifie si elle atteint le pane ou si l’erreur de tmux est déclenchée. Le travail est terminé lorsque literal=False et literal=True se comportent comme prévu avec un texte commençant par un tiret.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Summary
Pane.send_keys("-n hello") returns normally, yet nothing reaches the pane, with literal=False and with literal=True. tmux rejects the call with unknown flag -n and exit status 1. send_keys passes the text right after its own flags with no --, and does not check the result. Text that starts with - is ordinary in scripted input: command-line flags, Markdown bullets, negative numbers.
Reproduction
- Start a private server with a
shpane and send text that starts with-:
import libtmux
srv = libtmux.Server(socket_name="sendkeys-dash", config_file="/dev/null")
pane = srv.new_session("probe", window_command="sh").active_window.active_pane
pane.send_keys("-n hello", enter=False)
pane.send_keys("-n hello", enter=False, literal=True)
print(repr(pane.capture_pane()[-1]))
srv.kill()
- Send the same text through
Pane.cmdwith--:
proc = pane.cmd("send-keys", "-l", "--", "-n hello")
Expected
The pane shows $ -n hello, or send_keys raises with tmux's error.
Actual
The pane shows '$'. Both calls return without raising. The raw call without -- fails with command send-keys: unknown flag -n; with -- it types the text.
Environment
- libtmux:
masterat886b1cd(v0.62.0 plus 114 commits) - tmux: 3.8 (system build reports 3.8a)
- Python: run with
uv run --frozenfrom the libtmux checkout - OS: Linux (WSL2), private
-Lsocket,-f /dev/null
Evidence
send_keys('-n hello', literal=False): no exception
send_keys('-n hello', literal=True): no exception
pane line after sends: '$'
pane.cmd('send-keys', ('-l', '-n hello')): returncode=1 stderr=['command send-keys: unknown flag -n']
pane.cmd('send-keys', ('-l', '--', '-n hello')): returncode=0 stderr=[]
pane line after raw sends: '$ -n hello'
References
- The call that builds the argv:
src/libtmux/pane.py#L847 - The Go and TypeScript ports put
--before the text:tmux/pane_input.go#L248,pane_io.ts#L30 - Projects that guard this by hand: mitsuhiko/agent-stuff tells agents to send
-l --(SKILL.md#L54); ntm notes a trailing;is eaten even after--(session.go#L1969); UltiSnips escapes by trial (vim_interface.py#L161)
- Langage dominant
- Python
- Étoiles
- 1.2k
- Forks
- 127
- Merge moyen
- 2 h 37 min
- PR mergées (30 j)
- 33
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de tmux-python/libtmux
-
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
tmux-python/libtmux#856 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 83/100
tmux-python/libtmux#839 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
`show_option` coerces user options, so an `@` option set to `123` or `on` comes back as an int or a boolPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
tmux-python/libtmux#759 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
tmux-python/libtmux#745 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Documentation: how to use internal libtmux loggingPeut-être pris @tony l’a pris il y a 84 jours. Ouverteenhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
tmux-python/libtmux#744 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de tmux-python/libtmux
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
deepchem/deepchem#5289 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
Pull Request for pretty_macOuverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 75/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 60/100
UKGovernmentBEIS/inspect_evals#2892 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Versioning docs: say that no output from the 0.46 warning check means nothing is affectedPeut-être pris @grelinfo l’a pris aujourd’hui. Ouvertedocumentation priority:low size:S
Difficulté 1/5 Moins d'une heure Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
alphacrack/readme2demo#293 ·