0

I usually start my second terminal from tmux by a cumbersome steps

1) Start a terminal ( I used alacritty)
2) initiate a tmux session tmux new -s 'main'
3) start a second terminal alacritty

The I closed the first terminal and work on the second one.

The steps is clumsy, since the first terminal invoked only as an intermediate.

How could start the first terminal(alacritty) directly from tmux?

  • Please delete your first question before you ask it again. – danzel May 30 at 22:46
  • okay, deleted it, ty @danzel – Algebra May 30 at 22:49
3

alacritty is a terminal emulator. It's the drawing on your GUI that lets you do thing as if you were on the console.

tmux is a terminal multiplexer like screen that lets you run multiple terminal sessions within a single terminal but that can remain active even if you end your terminal application or connection.

You can connect to tmux from within alacritty or any other terminal emulator or ssh, etc connection. You can even connect to the same session from multiple terminals.

  1. Start alacritty however you start it.

  2. Type tmux attach || tmux new to attach to an existing session or start a new one.

  3. Use tmux attach -t target-name || tmux new -s target-name to attach or create to a specific session.

Alternatively a script file:

~/bin/tmuxed:

#!/bin/bash
tmux attach -t MyFavSession || tmux new -s MyFavSession

Create a shortcut or edit the Alacritty menu entry to...

alacritty -e $HOME/bin/tmuxed

...to start alacritty with the tmux attach/new command automatically.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.