mskyaxl / wsl-terminal

Terminal emulator for Windows Subsystem for Linux (WSL)
MIT License
3.12k stars 158 forks source link

Can't open with emacs in wsl-terminal #155

Closed flying-ming closed 4 years ago

flying-ming commented 5 years ago

I modify the 5-add-open-with-vim-menu.js script and rename vim.exe to emacsclient.exe in order to open file with emacs, but wsl-terminal appears to disappear immediately. script content like this:

var WshShell = new ActiveXObject("WScript.Shell");

WshShell.CurrentDirectory = "..";
WshShell.RegWrite("HKCU\\Software\\Classes\\*\\shell\\vim-in-wsl-terminal\\"
    , "Open with emacs in wsl-terminal", "REG_SZ");
WshShell.RegWrite("HKCU\\Software\\Classes\\*\\shell\\vim-in-wsl-terminal\\icon"
    , "\"" + WshShell.CurrentDirectory + "\\emacsclient.exe\"" );
WshShell.RegWrite("HKCU\\Software\\Classes\\*\\shell\\vim-in-wsl-terminal\\command\\"
    , "\"" + WshShell.CurrentDirectory + "\\emacsclient.exe\" -n \"%1\"", "REG_SZ");

In wsl, i already install emacs. What's the problem? I want to help!

flying-ming commented 5 years ago

In original script, vim is usable.

mskyaxl commented 4 years ago

I have never used emacs but it

seems to be working for me with

`var WshShell = new ActiveXObject("WScript.Shell");

WshShell.CurrentDirectory = ".."; WshShell.RegWrite("HKCU\Software\Classes\\shell\emacs-in-wsl-terminal\" , "Open with &emacs in wsl-terminal", "REG_SZ"); WshShell.RegWrite("HKCU\Software\Classes\*\shell\emacs-in-wsl-terminal\ic\ on" , "\"" + WshShell.CurrentDirectory + "\emacs.exe\"" ); WshShell.RegWrite("HKCU\Software\Classes\\shell\emacs-in-wsl-terminal\co\ mmand\" , "\"" + WshShell.CurrentDirectory + "\emacs.exe\" \"%1\"", "REG_SZ");`

Of course I renamed the binary to emacsclient.exe instead of emacsclient.exe

If that's fine I will include it in the next release :)