神刀安全网

Tmux Support Arrives for Bash on Ubuntu on Windows

In Windows 10 build 14361, available now to Windows Insiders fast-ring users, we’ve added Pseudo Terminal support to Windows Subsystem for Linux (WSL) which, along with improvements to Windows Console’s much improved support for rendering VT control sequences , enables Tmux support to light-up your console!

For those not familiar with it, Tmux is a terminal multiplexer – a popular (even essential) command-line tool that allows one to divide a console/terminal window into multiple “panes” and render the output of a shell and/or tool in each “pane”, and to switch input between each pane.

Tmux relies on a *NIX feature called Pseudo Terminals (PTY) that are attached to a process running a shell/tool, and which virtualize the behaviors of a terminal. A physical terminal (TTY) can then be attached to any PTY … or more than one in the case of Tmux: Tmux “attaches” each “pane” it contains to a separate PTY, allowing a single console/terminal to render the output of several *NIX tools in their own “pane” within the console.

To start, let’s open Bash on Ubuntu on Windows and install Tmux using apt-get:

Tmux Support Arrives for Bash on Ubuntu on Windows

We start Tmux by running … well … tmuxThis will clear your screen and add a (customizable) status bar to the bottom of the screen.

Tmux Support Arrives for Bash on Ubuntu on Windows

First, let’s split the current pane vertically using [CTRL B] + [%]:

Tmux Support Arrives for Bash on Ubuntu on Windows

Now let’s split this new pane horizontally using [CTRL B] + [“]

Tmux Support Arrives for Bash on Ubuntu on Windows

Cool! So, using [CTRL B] + [Arrow-key | P | N] we can navigate between panes. Let’s return to the left-hand pane and open a file in vim (e.g. “vim hello.cpp” in this case):

Tmux Support Arrives for Bash on Ubuntu on Windows

If we now navigate to the top-right pane again, and run “htop”, we can see a textual process monitor:

Tmux Support Arrives for Bash on Ubuntu on Windows

Move to the bottom-right pane and run “fortune | cowsay” (install using apt-get if they’re missing), and you can see a cow read out the fortune cookie message of the day

Tmux Support Arrives for Bash on Ubuntu on Windows

Three panes just aren’t fancy enough, so let’s split the left hand pane again: Navigate to the left pane using [CTRL B] + [Arrow-key] and hit [CTRL B] + [“] to split horizontally.

Now run “cacademo” (install using apt-get install caca-utils) and you’ll see a selection of crazy swirling and dripping text-effects!:

Tmux Support Arrives for Bash on Ubuntu on Windows

This is just a taste of what Tmux can do, but as you can imagine, its an amazingly powerful multi-paned terminals within a terminal tool that you can use to build dashboards of tools to suit many of your geeky needs!

Enjoy!

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » Tmux Support Arrives for Bash on Ubuntu on Windows

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址