`Pane.send_keys` types nothing and raises nothing for text that starts with `-`
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 82/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- backend-api-design, cli
Línea de trabajo
Lee src/libtmux/pane.py alrededor de la construcción de argv de Pane.send_keys en la línea 847 y comprueba cómo Pane.cmd gestiona los argumentos de tmux. Reproduce el caso con la entrada proporcionada -n hello y luego verifica si llega al pane o si se produce el error de tmux. El trabajo estará listo cuando literal=False y literal=True se comporten como se espera con texto que comienza con un guion.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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)
- Lenguaje dominante
- Python
- Estrellas
- 1.2k
- Forks
- 127
- Merge medio
- 2 h 37 min
- PR fusionados (30 d)
- 33
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de tmux-python/libtmux
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
tmux-python/libtmux#856 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
tmux-python/libtmux#839 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
`show_option` coerces user options, so an `@` option set to `123` or `on` comes back as an int or a boolPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
tmux-python/libtmux#759 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
tmux-python/libtmux#745 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Documentation: how to use internal libtmux loggingPosiblemente ocupada @tony la tomó hace 84 días. Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
tmux-python/libtmux#744 ·
Los mantenedores suelen responder en 1 día
Todos los issues de tmux-python/libtmux
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
deepchem/deepchem#5289 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Pull Request for pretty_macAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 60/100
UKGovernmentBEIS/inspect_evals#2892 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Versioning docs: say that no output from the 0.46 warning check means nothing is affectedPosiblemente ocupada @grelinfo la tomó hoy. Abiertodocumentation priority:low size:S
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
alphacrack/readme2demo#293 ·