Fuzzy-switching sesssion in tmux script

3 years ago by Howard Do to c/shell

During my work, I use multiple Tmux sessions to manage different projects. When I create a new session, I usually give it unique name so that I know that the project is about via the session name.

I found this post really helpful to anyone who is using tmux

gelert 5 points 3 years ago

If you're using Neovim as well as tmux, telescope-tmux is pretty awesome for switching sessions, windows and more.

path: 0 144245, hotness: undefined, score: 5, children: 3
howarddo 1 point 3 years ago

Very nice, thanks. But I'm not always inside neovim to use this plugin tho

path: 0 144245 159291, hotness: undefined, score: 1, children: 2
gelert 2 points 3 years ago

You don't have to already be inside of Neovim.

Tmux 3.2's new display-popup command is a neat way to access the telescope picker when you are outside of Neovim.

source: https://github.com/...

You can just set up a keybinding, and a new instance of Neovim will start in a popup window inside of Tmux.

There's a fractional delay while Neovim starts up, but I find it well within tolerance, personally.

path: 0 144245 159291 161470, hotness: undefined, score: 2, children: 1
howarddo 1 point 3 years ago

nice, I'll check it out

path: 0 144245 159291 161470 162074, hotness: undefined, score: 1, children: 0
chaoticAnimals 2 points 3 years ago

I don't know how I missed this. Ty!

path: 0 217741, hotness: undefined, score: 2, children: 0
gamma 2 points 3 years ago

I've only used the builtin choose-session, and haven't had the need for anything more (I usually only have one session, maybe 3 at most) but this gives me ideas to iterate over all open panes with previews given by fzf --preview 'tmux capture-pane -p -t {}'.

path: 0 119895, hotness: undefined, score: 2, children: 1
howarddo 2 points 3 years ago

Yeah, whatever fits you, I usually open each repo in seperated session with tmux-sessionizer so fuzzy find session is useful

path: 0 119895 119975, hotness: undefined, score: 2, children: 0
shell
shell

@programming.dev

login for more options
1615
50
1

From Ash, Bash and Csh to Xonsh, Ysh and Zsh; all shell languages are welcome here!

Rules:
  1. Follow Lemmy rules!
  2. Posts must relate to shell scripting. (See bottom of sidebar for more information.)
  3. Only make helpful replies to questions. This is not the place for low effort joke answers.
  4. No discussion about piracy or hacking.
  5. If you find a solution to your problem by other means, please take your time to write down the steps you used to solve your problem in the original post. You can potentially help others having the same problem!
  6. These rules will change as the community grows.

Keep posts about shell scripting! Here are some guidelines to help:

  • Allowed: Release Announcement of a command-line program designed for scripted use (e.g. bash, bats, awk, jq, coreutils/moreutils)
  • Allowed: Tutorials on using shell languages or supplementary tools designed for scripted use
  • Allowed: Code review/help requests for shell languages or supplementary tools designed for scripted use
  • NOT Allowed: Announcement of a CLI or TUI program that is not designed for scripted use (Yes, your fancy Zsh plugin which pretty-prints the date and time using only builtins is very cool, but unless you actually want to discuss the code itself, please check out !commandline instead!)
  • NOT Allowed: Domain-specific tutorials that do not involve shell scripting as a core component (e.g. docker-compose, ansible, nix). If you really love one of these, I'm sure there's a community out there ready to talk about them!
  • NOT Allowed: Code review requests for non-shell programming languages and configuration languages (e.g. Python, Yaml)

In general, if your submission text is primarily shell code, then it is welcome here!

go to feed...