Recently, when using an open source tool, I found a tool called tmux. Then I found that Tmux is quite popular, the repo star has 20K+, and my commonly used iTerm2 is also integrated with tmux. Based on this, it is necessary to understand tmux and clarify the usage scenarios.

Since the current use is still shallow, please point out if any mistakes

Concept

Start with the concept and understand its function.

tmux is a terminal multiplexer. It lets you switch easily between several programs in one terminal, detach them (they keep running in the background) and reattach them to a different terminal.

  1. Personal understanding is that tmux saves the terminal session on-site. For example, SSH is connected to a VPS, vi edit a file, directly closes the session, and then reopens the connection, you will find that the state is lost, you need to re-enter the target path and reopen it edit. With tmux, you can save this session, re-access the target machine, load the previously saved session, and everything will be restored as before.
  2. The reason why tmux can save sessions is because after tmux is installed on the target server, a separate service will be started for on-site saving.

Tmux Installation

Understand the above principles, you can understand that tmux is not necessarily installed locally, but installed on the machine that needs to save the session.

The installation commands in common operating system environments are as follows

1
2
3
4
5
# macOS
brew install tmux

# centos
yum install tmux
Read more »

Maintaining open-source projects requires effort, and monetary rewards are a great incentive. GitHub now provides a sponsor mechanism allowing you to support project developers easily. Here’s how to proceed.

Sponsoring Others

On the right side of a project, under “Sponsor this project,” click on the ❤️ next to each specific developer to sponsor them. You can choose between one-time payments or regular payments.

Applying for Sponsorship

Read more »

Recently, I spent some time trying out VSC and JB’s remote development tools. I think they’re good, so here’s a brief introduction.

From now on, high-overhead compilation tasks can be handled by remote machines.

Of course, to ensure smooth remote operation, both the remote machine and the local network need to meet high requirements.

Visual Studio Code

Read more »

Nowadays, many services have a 2FA mechanism, requiring SMS verification for login or online payments. Upon receiving the SMS, users need to input the verification code.

The iPhone supports automatic extraction, and you can fill in the code with just a tap. However, on the Mac, only Safari offers a similar experience. If you use Chrome or other apps, you lose this convenience. To address this shortcoming, a workflow was developed to enhance the experience.

Download link: Click here

Screenshot

As shown above, after receiving the message, wait a few seconds. Once the SMS is received, type 2fa to invoke the workflow, select the verification code item, and press Enter to copy it to the clipboard. Use ⌘ + v to paste it into the target input field.

Read more »

Sometimes, retrieving an app’s ID or version information on a Mac can be inefficient if you manually check and copy it via Finder. Therefore, I used Alfred’s Universal action to achieve a one-click retrieval.

Screenshot

Pressing Enter copies it directly to the clipboard.

Read more »
0%