Close tmux session9/10/2023 ![]() ![]() Traps allow you to listen and to POSIX signals and do things when they happen. After spending way too much time thinking how I could override CTRL+d in tmux, I thought of a simpler alternative: a shell trap! Shell traps When that happens, I sight and reconnect.Įventually, I had enough and decided to look for a way to fix it. The issue with my workflow is that, when I’m in the last pane of the last window of the current session, if I exit that shell, it also exits tmux (because my SSH command is tmux), and, as expected, it also kills my SSH connection. I have been closing terminals with CTRL+d for as long as I can remember, so that’s burned in my “muscle memory” forever. I also always get the most used projects first, so that prevents some keypresses, which is always nice. I don’t even know how many sessions I have open, nor what session has what running… all I know is that I create one session for each project I work on and that I always have a default session to work on random things. The main advantage to this: it is predictable. find $PROJECTS/* -type d -maxdepth 0 | while read -r p do # get the projects in each namespace with their zoxide scores zoxide query -l -s " $p /" done | sort -rnk1 | # sort by zoxide score (first column) fzf -no-sort | # pipe to fzf without its sorting awk '' # use the path as selected (second column) ) Selected = $( # get my project's namespaces # I have it organized in namespaces per organization, so I have # my personal org (caarlos0), one for work, one for goreleaser, and so on. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |