`Server.kill_session(name)` kills a session whose name only starts with `name`
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 83/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- backend-api-design
Research direction
Read src/libtmux/server.py around Server.kill_session (lines 483–500) and compare its target handling with has_session(exact=True) around line 429. Then find the relevant kill-session tests and run them. Done means killing a nonexistent exact name raises while a session whose name only shares that prefix remains.
Written by the indexing model from the issue text.
Description
Summary
Server.kill_session("doom") removes a session named doomsday when no doom exists. It passes the bare name to kill-session -t, and tmux resolves a bare target by prefix and fnmatch(3). The docstring says so ("'asdf' will kill 'asdfasd'"), while Server.has_session() already defaults to exact=True. Scripts that kill by name can end someone else's session.
Reproduction
- Create two sessions and kill by the shorter name:
import libtmux
srv = libtmux.Server(socket_name="kill-prefix", config_file="/dev/null")
srv.new_session("probe", window_command="sh")
srv.new_session("doomsday", window_command="sh")
srv.kill_session("doom")
print(sorted(s.name for s in srv.sessions))
srv.kill()
Expected
kill_session("doom") raises because no session named doom exists, and doomsday survives.
Actual
It returns normally and doomsday is gone: ['probe'].
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
References
src/libtmux/server.py#L483-L500, docstring at#L489;has_session(exact=True)at#L429- Projects that target
=nameby hand: claude-squad (tmux.go#L470, "-t name does a prefix match, which is wrong"), firstmate (tmux.sh#L53), Qwen Code (ab-drive.ts#L316), NVIDIA IsaacCapture (launcher.py#L388), Microsoft amplifier-bundle-converge (tmux_view.py#L131), OpenAI tunnel-client (session.go#L714) - Ports: .NET kills
=name; Java looks the name up exactly; Go passes the bare name (lifecycle_kill.go#L101)
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 127
- Avg merge
- 2h 37m
- Merged PRs (30d)
- 33
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tmux-python/libtmux
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
tmux-python/libtmux#856 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
tmux-python/libtmux#838 · 1 comment ·
Maintainers usually reply within 1 day
-
`show_option` coerces user options, so an `@` option set to `123` or `on` comes back as an int or a boolPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
tmux-python/libtmux#759 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
tmux-python/libtmux#745 · 2 comments ·
Maintainers usually reply within 1 day
-
Documentation: how to use internal libtmux loggingPossibly taken @tony claimed this 84 days ago. Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
tmux-python/libtmux#744 ·
Maintainers usually reply within 1 day
All issues in tmux-python/libtmux
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
deepchem/deepchem#5289 · 1 comment ·
Maintainers usually reply within 2 days
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 60/100
UKGovernmentBEIS/inspect_evals#2892 · 1 comment ·
Maintainers usually reply within 1 day
-
Versioning docs: say that no output from the 0.46 warning check means nothing is affectedPossibly taken @grelinfo claimed this today. Opendocumentation priority:low size:S
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
alphacrack/readme2demo#293 ·