martanne / abduco

abduco provides session management i.e. it allows programs to be run independently from its controlling terminal. That is programs can be detached - run in the background - and then later reattached. Together with dvtm it provides a simpler and cleaner alternative to tmux or screen.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: Auto naming of sessions

palb91 opened this issue · comments

Calling simply tmux from the terminal creates a session with a name (which is an integer starting from 0).

I use tmux for only one thing, keeping my sessions opened whatever happened to my terminal (except killed with ^D or exit of course). So when a terminal is opened, I run a script that check if there is an not-attached session, attach to it if exists, else create a new session.

Would it be possible to add an "auto-naming" mecanism when a new session is created instead of having to manually set it?

What do you mean by “manually”? You can auto-generate some random name, for example with date +%s, or $RANDOM if needed and make a shell alias or function to it.

I already have a script that try to do that, I was wondering if it could be possible to have the same behavior builtin.
However, I was too focused on the way tmux names its sessions and try to replicate it. So I currently have several checks and incrementations that I don't need if I use something like date +%s as you suggested.

But I don't need this wrapper script if it's builtin, so is that a possibility ?

On the other hand, I'll always have a script to detect non-attached session, so maybe I already have the correct approach…

@palb91

You can always create a fork and add your auto naming feature and use this repo to pull in upstream changes/updates as needed

I know I have that possibility, I'm not reluctant to contribute to projects in general, but just not in C (and a lot of other languages, like anyone in fact). My only contributions for C projects will be limited to bug reports, proposition of features and discussion about them.