Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

How do I launch emacs in terminal mode within Powershell?

Writer Andrew Henderson

When I do the obvious thing in Powershell:

Start-Process "C:\bin\emacs-23.3\bin\emacs.exe" -ArgumentList "-nw"

Then emacs loads a new "cmd.exe" terminal, within which it is in terminal mode, instead of starting in terminal mode within Powershell. How can I start emacs in terminal mode within the existing Powershell terminal?

1

2 Answers

I can't test it cause I don't use emacs. Does it load within PowerShell if you just invoke it?

C:\bin\emacs-23.3\bin\emacs.exe -nw
1

Install GNU Emacs from winget

winget install "GNU Emacs"

Then add this code block in your Microsoft.PowerShell_profile.ps1

$emacs_wildcard = "${Env:ProgramFiles}\Emacs\*\bin\emacs.exe"
if ($(Test-Path $emacs_wildcard)) { $emacs_path = (Get-ChildItem $emacs_wildcard)[-1].FullName -replace ' ', '` ' function emacs { "$emacs_path -nw $args" | Invoke-Expression }
}

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy