動機 / Motivation

そうだ、minttyでwslを叩こう!
That's right, let's run WSL on Mintty!

minttyでwslを使うためのショートカットの作り方

How to create a shortcut to launch WSL in mintty

パスを端折るとこんな感じ
If you omit the path, it looks like this:

 mintty.exe wsl bash --login

cygwinとwslでconfigを別にするには、-c オプションで上書きするconfigを指定
To use different configs for cygwin and wsl, use the -c option to specify the config to be overwritten.

 mintty.exe -c \path\to\.minttyrc.wsl wsl bash --login

tmux で Esc キーが効かない

Esc key doesn't work in tmux

例)vimでEscキーが使えなくなる・・・地獄
ex.: The Esc key no longer works in vim... it's hell!

原因がわからない。。。
I don't know the cause...

対症療法で AutoHotKey を使い、mintty.exe のウィンドウでは Esc -> Ctrl+[ にキーコードを置き換えている
As a workaround, I use AutoHotKey to replace the key code with Esc -> Ctrl+[ in the mintty.exe window.

#SingleInstance
SendMode("Input")  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir(A_ScriptDir)  ; Ensures a consistent starting directory.
SetKeyDelay(20) ; https://bit.ly/3yIPG4x AutoHotkey設定メモ

#HotIf WinActive("ahk_exe mintty.exe")
  Esc::Send "^["
#HotIf

余談 / Digression

最初は Windows Terminal に乗り換えたのですが、tmuxで上下分割しているときに、上ペインで大量のテキストを表示させると下ペインの下段がバタついて選択文字列が外れたりするので使うのを止めました。

At first I switched to Windows Terminal, but when I used tmux with a top-bottom split, if I displayed a large amount of text in the top pane, the bottom row of the bottom pane would flap around and the selected text would get lost, so I stopped using it.


トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2024-11-11 (月) 10:24:29