It's quite an indictment of the current state of our tooling (not just tmux) that such an application as this is necessary. Why isn't it easy to configure this in tmux itself, and persist the resulting configuration?
My use case for building Cockpit was to easily generate scripts for my different layouts. These scripts I use with
https://github.com/fitztrev/shuttle so I could load my workspace with a single click.
I am not sure if this application is necessary. However, I think everyone can find their own use cases.
I wonder if there is some sort of inverse relationship between having comprehensive features, thereby being self-contained (think Smalltalk), versus having a continuous dialog with the imperfect outside environment (think perl). I'm sure this is implicit in the famous "Worse is Better" essay, if not explicit.
I mean: the author of tmux could have bundled the package with a comprehensive environment. But what really is there, beyond Unix and the browser? If it exists, people haven't heard if it, and even if they had, would just as soon reinvent it. At any rate, the inevitable imperfections and inpedance-mismatch with users' existing workflow / UI would surely invite brutal criticism. (For example, when Plan 9 came up here a few years back, a big chunk of the discussion was about how ugly the GUI seemed to them!)
I highly recommend https://github.com/tmuxinator/tmuxinator if you haven't tried it, I've actually used it to run whole microservice environments locally and works without a hitch
The defaults are a little funky but they’re easy enough to change. I have mine so prefix+s splits horizontally and prefix+v splits vertically. And then prefix+(H,J,K,L) resizes.
It's not for me, though. Maybe I'm not a very good systems engineer, but I've got a decent .tmux.conf. Between writing automation and trying to make sense of the mess I've inherited, I'm constantly splitting, resizing, and re-adjusting my work space to suit the task at hand.
+1
The mnemonics that come with tmux are short and intuitive enough such that everything ive needed is just a ctrl+b away.
Curious what the use case is for this
Example where I would have needed this a while ago:
After almost every reboot on my laptop I start a tmux with a certain layout with some semi-long-running processes which I want active and not daemonized, I can also not start them at the same time. I start them in a tmux with the layout split into 4 quadrants, then create a single new window so I don't see them all the time and can work there.
Took me at least 2h to figure that out, how to split it programmatically and start everything in the correct "corner". Now it's just running a script and not having to anything manually.
This would have probably saved me 2h. And I have totally forgotten everything again now, so much for "just a ctrl-b" away. (Using tmux daily, but not in THIS way)
The one major advantage is preserving sessions and re-attaching to them later, e.g. when you're ssh'ed into a remote machine or VM and you don't want to lose your setup.
Ratpoison could possibly be better (I keep meaning to give it a shot), although one thing I really enjoy about using tmux is being able to quickly open, shuffle, reorganize, and close panes with only the overhead of starting a new shell.
I happen to be a vim user. tmux, vim, vim-tmux-navigator, and some comfortable configurations in .vimrc and .tmux.conf can be a force multiplier for one's workflow. If you like vim, then it makes a lot of sense. If you don't, there's still probably some merit, but, maybe less of an incentive.
I've never used ratpoison, but just read into it. Sounds pretty great, actually. If the key bindings are simple enough, I suppose it could be pretty similar. But, as a sibling comment pointed out, it works most everywhere. Where I go, my configuration comes with me.
When you say scrolling, do you mean with something other than a keyboard?
I thought this is something I wanted, but when I finally got around to getting mouse inputs working the way I thought they should, I realized that mousing around a terminal is kind of weird. Granted, I still use my mouse for copy/pasta operations, but I hope to eventually break that habit in time.
Nowadays, it's basically a simple way to let process running after existing the shell and reattaching later, for me.
But I had much greater ambitions in the past which I've given up mostly due to scrolling, clearing scrollback inserting a bunch of whitespace instead of actually clearing, etc.
I scroll with the mouse a lot, it's more tolerable with the keyboard, but it's still not as good as native interaction.
It also messes with the colors sometimes. For some reason, screen doesn't.
Nice tool. I suggest showing the script beside the window so it can easily be cut-and-pasted. Browser downloading is a hassle especially with tmux on a remote server.
I was using tmuxinator for this, but found that all of my sessions were essentially the same thing except for the name and the working directory.
So I just wrote a shell script that takes a directory, using basename for the session name, starting up what ever windows and panes it needs to. I have two variants, one for generic dev stuff (shell and an editor) and the other is for rails work (shell, editor, logs, rails db and a rails c in the last window).
Nice work. I’ve been using teamocil (https://github.com/remiprev/teamocil) so far (which is doubly nice because its configs can be used with plain iterm via itermocil) but will take a look at this too!
Thank you. I have a small attachment to the name ‘Cockpit’. Three years ago, me and my friends, we used to spend quite some time in hacking projects or automating our workflow. It was at that time, we created a
a tool called ‘Cockpit’ (https://github.com/27AE60/cockpit) for configuring Terminal workspace in Linux. Over the years, I started concentrating on one terminal. And when I shifted to iTerm2 along with Tmux, I wanted to spend less time in configuring workspace and more on my code. Then, I realized, I end up with similar Tmux layouts for most of my prototypes and I wanted to reduce my time in re-loading the projects. I wanted a visual representation of Tmux and flexibility in terms of scripts instead of installing applications. This tool reminded me of my old project and so, I couldn’t think a better name than Cockpit.
It is not possible to create 3 equal sized horizontal panes with Cockpit. What I normally do is, create three horizontal splits in Cockpit and in tmux, I use `leader-key space` which makes tmux cycle through available layouts, and in one of them is equal sized horizontal windows.
I found a small bug: When you have an edit field open and try to open another one (command/session name/window name), the second one will just be cleared to blank.
Thanks. I've received a similar comment in this thread regarding 'Cockpit' name conflict. I have explained my reasons in reply to the comment by @recentdarkness
Thanks.I wanted an easy script creator from my dynamic yet simple layouts, so I thought of building Cockpit. Now, all I do is re-run the script generated from the app.