Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Feature Request: Get current session

Open
#252 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
api, cli

Research direction

Start with the suggested server.list_sessions()[0] approach in the quickstart documentation and inspect how libtmux represents sessions. Compare that listing with the current session reported by tmux when running inside a tmux client. Done means the Python API reliably returns the session containing the current command-line client rather than the first listed session.

Written by the indexing model from the issue text.

Description

When using tmux on the command-line, I can get the current session by running tmux ls.

It would be useful if libtmux could do the same.

The suggested approach of using server.list_sessions()[0] does not work. It returns whichever session is at the top of tmux's listing, not necessarily the current one.

Dominant language
Python
Stars
1.2k
Forks
127
Avg merge
2h 13m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tmux-python/libtmux

All issues in tmux-python/libtmux

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.