Adding and Using Windows Subsystem for Linux (WSL) from Sublime Text

 Adding WSL to inside of Sublime Text 3

I will show how to use WSL from Sublime text like in the photo above.

Firstly open Command Palatte from menu or with "Ctrl Shift P"

Search for the "Install package". Then search the "Terminus" package and install it.


After installation open Terminus's command palette like in photo above and then paste this code below and save.

///////////////////////////////////////////////////////////
//           Sglbl
//////////////////////////////////////////////////////////
[
    // Opens Command Prompt in the panel at the bottom of the screen
    {
         "caption": "Command Prompt (panel)",
         "command": "terminus_open",
         "args"   : {
         	"cmd": "cmd.exe",
            "cwd": "${file_path:${folder}}",
            "title": "Command Prompt",

            "panel_name": "Terminus"
         }
    }
]

Then with same place in the photo above, open Terminus's Key Bindings. Then paste the code below and save.

///////////////////////////////////////////////////////////
//           Sglbl.com
//////////////////////////////////////////////////////////
[
	// Togle Terminus panel Open/Closed when Alt+" is pressed
	{
		// The key press to look out for
		"keys": ["alt+`"],
		// Toggle the panel
		"command": "toggle_terminus_panel"
	},

	// Open cmd.exe Command Prompt when Alt+1 is pressed
	{
		// The key press to look out for
		"keys": ["alt+1"],

		// Tell terminus to open something
		"command": "terminus_open",

		// Tell terminus what to open
		"args" : {
			// Open Command Prompt
         	        "cmd": ["C:\\Windows\\system32\\wsl.exe" ],
         	         // Provide Command Prompt with Current Directory
                        "cwd": "${file_path:${folder}}",
                         // Putting it in the panel at the bottom
                        "panel_name": "Terminus"
                }
	}
]

Everything is done. You can open the integrated terminal with Alt + 1 , and you can close it with Alt + "

If you want to change the theme of the terminal, open Command palette with Ctrl Shift P , then write "Terminus Utilities: Select Theme" . 
Paylaş:

Ara