Saturday, February 20, 2016

Windows PowerShell Run Command in Background

I've been really playing around in the Windows world for my development environment, and I'm pleased with a lot of the enhancements since my XP days.  One of the things I've been trying to do is get emacs with ElPy installed in it to use the appropriate anaconda version.  I figured the best way to do that would be similar to how I do it on OS X and GNU/Linux.  Enter my new adventures in PowerShell.

When I launch emacs from PowerShell, however, I can't use the handy "&" as in *NIX systems.  Enter this discussion on how to run commands in the background.

So, once I figure out the configuration files for the PowerShell, I'll be sure to create this as an alias:

function bg() {Start-Process -NoNewWindow @args}

So, apparently the virtual environments in Anaconda aren't behaving well in PowerShell, so I have to go back to the command prompt.  So, per this conversation, I can just run a command in the background that way by using:

START "" <emacs.exe>

I should probably look at "help start" to tweak it to behave as I want.

No comments:

Post a Comment