Discussion:
can i launch a process in the background?
(too old to reply)
Xah Lee
2009-08-04 21:14:47 UTC
Permalink
is there a way to launch a program in PowerShell but still have access
to the shell?

e.g. when i do

emacs

PowerShell launches emacs, but as long as that emacs is still running,
i don't have access to the shell anymore. (PowerShell ISE tells me
“Already running a command. Please wait.”)

Am looking for something similar to unix's “emacs &”.

Thanks.

Xah
∑ http://xahlee.org/


Marco Shaw [MVP]
2009-08-04 22:21:18 UTC
Permalink
Assuming you have the latest PowerShell v2 CTP:
PS> start-job {emacs}
Post by Xah Lee
is there a way to launch a program in PowerShell but still have access
to the shell?
e.g. when i do
emacs
PowerShell launches emacs, but as long as that emacs is still running,
i don't have access to the shell anymore. (PowerShell ISE tells me
“Already running a command. Please wait.”)
Am looking for something similar to unix's “emacs &”.
Thanks.
Xah
∑ http://xahlee.org/

unknown
2009-08-05 04:34:51 UTC
Permalink
Another option for external applications that may take over the console (as
opposed to cmdlets/scripts that may return PowerShell data) is to start it
as a process. In PowerShell 2, you can use the Start-Process command. If you
want to retain a connection to the process, use the -PassThru parameter:

start-process emacs -PassThru

Even if this is a console emacs, it will be spawned in a new window by
default.

In PS1, use this:

[diagnostics.process]::Start("cmd")
Post by Xah Lee
is there a way to launch a program in PowerShell but still have access
to the shell?
e.g. when i do
emacs
PowerShell launches emacs, but as long as that emacs is still running,
i don't have access to the shell anymore. (PowerShell ISE tells me
“Already running a command. Please wait.”)
Am looking for something similar to unix's “emacs &”.
Thanks.
Xah
∑ http://xahlee.org/

Xah Lee
2009-09-17 20:56:31 UTC
Permalink
Thanks. I got it to work.

# launch ErgoEmacs with latest source code and your own emacs
customization
function ErgoEmacsLaunch
{
start-process "C:\Program Files (x86)\ErgoEmacs\bin\runemacs.exe" -
ArgumentList "-Q", "--load=~\ErgoEmacs_Source\ergoemacs\ergoemacs
\init.el", "--load=~\.emacs"
}

set-alias ee ErgoEmacsLaunch

Xah
∑ http://xahlee.org/



On Aug 4, 9:34 pm, "Alex K. Angelopoulos" <alex(dot) k(dot again)
Post by unknown
Another option for external applications that may take over the console (as
opposed to cmdlets/scripts that may returnPowerShelldata) is to start it
as a process. InPowerShell2, you can use the Start-Process command. If you
start-processe macs-PassThru
Even if this is a consoleemacs, it will be spawned in a new window by
default.
[diagnostics.process]::Start("cmd")
Loading...