Live data from Hacker News

Tmux Tutorial

leimao.github.io

111–120 of 166 posts

Re: Tmux Tutorial

#113
I tried to use tmux as a terminal multiplexer on sway just so I could make it remember a setup of terminals for specific projects. That way I could simply do `tmux-command start project-name` and have it automatically open a setup of windows and panes. Though I found it unfortunate that I had to learn new shortcuts that are different for shortcuts elsewhere. A simple example but which was a deal breaker was in order to work with its clipboard system, you had to use different commands. Does someone with more knowledge of tmux know whether it's possible to get rid of the prefix command somehow? I know about the i3 version of tmuxinator, but it doesn't support sway unfortunately. I might make something to automatically open a list of windows on a specific workspace for sway.

Re: Tmux Tutorial

#114
post #2

I have been using screen for almost 10 years now, is it worth switching? I know it's not much learning but why switching when screen is not broken? It feels like there's more important stuff I can learn.

I literally just switched in the past two months (actually, went from having used screen two jobs ago (~2 years ago) to using tmux at my current job). I'm on the tmux train now and I'm pretty happy with it.

Re: Tmux Tutorial

#115
post #14

Earlier quoted context omitted.

I often run screen sessions inside tmux if I need to ssh to remote machines. tmux is beautiful and I say that as a screen veteran.

> I often run screen sessions inside tmux if I need to ssh to remote machines What possible reason can there be?

I often run tmux in ssh in tmux. The outer tmux is just for my local terminals. The inner tmux is mostly so I can reattach later. Though it is also nice to easily get two shells on the remote machine side by side.

Re: Tmux Tutorial

#116
post #2

I have been using screen for almost 10 years now, is it worth switching? I know it's not much learning but why switching when screen is not broken? It feels like there's more important stuff I can learn.

Another option would be to split screen's roles of "terminal multiplexer" and "terminal detacher" into two programs: dvtm and abduco, respectively. I find that approach more flexible than screen/tmux, and it works better spanning work environments where I might or might not have tabs and splits built in to my window manager or terminal emulator. It's also nice to not have to give up C-a or C-b keybindings when I don'…

Better; use dvtm within Screen. This is what i do; one Screen session (fullscreen size) on my main dev box with each Screen window running its own dvtm instance. Thus each Screen window becomes a "workspace" (if needed, connected to a remote host) with dvtm-managed multiple tiles/shells. Flexible and not too complicated with all the power of Screen and the simplicity of dvtm. In fact, i use this setup even when working on my local machine. Throw in vim for the editor and you have a simple and standard setup which you can carry with you everywhere.

Re: Tmux Tutorial

#117
post #70

Am I the only one using screen? Couldn't switch to tmux since most of what i need is in screen.

Can we do vertical splits in screen without having to install additional plugins? How?

Yes. https://www.gnu.org/software/screen/manual/screen.html#Split

Re: Tmux Tutorial

#118

What's a good way to handle ssh and tmux, if I'm already in a tmux session in my desktop? I'm in a tmux session in my desktop. Then I ssh into a server from within tmux. I want to start tmux to be able multiplex and detach from some tasks. What do?

I remapped the prefix locally, and run vanilla tmux on remote boxes.

Re: Tmux Tutorial

#119
post #43

I used PM2[1] as process manager for Node.js, Python services in the cloud servers. It did its job well, apart from ensuring that process is always up, it provided monitoring capabilities(incl. emails), capturing logs from the stdout among other things. Recently I wanted to manage a Golang service, found that PM2 is not stable for it yet and I didn't want to install Node.js just for managing the Golang service; so us…

Tmux won't restart the service when it fails. It won't start the service when the machine reboots (or even if someone deliberately reboots the machine and forgets about the service). Assuming you're on a modern Linux distribution, it's pretty easy creating a systemd service file which will make it easier to manage the service.

You're correct, I should have mentioned the purpose. I'm currently testing the service, want it stop when it fails and just not when I exit the SSH; hence the tmux.

For restarting the service, systemd is the way to go.

Re: Tmux Tutorial

#120

I tried to use tmux as a terminal multiplexer on sway just so I could make it remember a setup of terminals for specific projects. That way I could simply do `tmux-command start project-name` and have it automatically open a setup of windows and panes. Though I found it unfortunate that I had to learn new shortcuts that are different for shortcuts elsewhere. A simple example but which was a deal breaker was in order…

iterm2 (macOS only, alas) will make a local or remote tmux session work like a native tabbed iterm window.
Post reply on HN