14 lines
No EOL
584 B
Markdown
14 lines
No EOL
584 B
Markdown
---
|
|
title: "automatic tmux session names"
|
|
date: 2020-07-13T11:38:52+02:00
|
|
draft: false
|
|
snippet_types: ["tmux"]
|
|
---
|
|
|
|
This month I ditched [XQuartz](https://www.xquartz.org/) and am back to using Tmux. One part I found tedious was manually naming sessions. I wrote this little alias help. When run from outside a tux session to creates a new session named after the current directory. Ex when in `/users/t.shears/dev/cool-app` a session named cool-app is created.
|
|
|
|
Excerpt from my `.zshrc`
|
|
|
|
```bash
|
|
alias tmux_new="tmux new -s \$(pwd | awk -F "/" '{print \$NF}' | sed 's/\./_/g')"
|
|
``` |