Automatic Grunt Watch in ConEmu Split Tab


ConEmu will run any shell that you have installed, and adds features that makes using those shells much more efficient and fun to use than if you were to run them independently.

If you’re using Node.js as part of your Web development workflow, chances are that you’re taking advantage of a task runner like Grunt or Gulp to automate certain tasks, e.g. concatenation, minification, and linting. I’m going to share how to create a task in ConEmu that will automatically split your view in half, create a new console on the right side, and then run grunt watch in that new console from your current directory.

Running Grunt Watch in a Split ConEmu Tab

ConEmu Task Settings for Grunt Watch

Setting up this task is incredibly simple:
Grunt Watch Task Settings in ConEmu

  1. Hit Win + Alt + P to bring up the ConEmu Settings window
  2. Select Tasks under the Startup menu
  3. Create a new task by clicking the + button
  4. Give this new task a name, like Scripts::Grunt Watch
  5. For Task parameters, enter /dir %cd% so that the new console is started in the same directory as your current console
  6. In the Commands box, enter cmd.exe /k "%ConEmuBaseDir%\CmdInit.cmd" -cur_console:sH & grunt watch
  7. Hit Save settings

It is as simple as that. If you are having any trouble, click on the screenshot of the settings above to view it at full size and verify what you entered.

Now you can simply open ConEmu, cd to the root directory of your project, and run this new task. What you’ll have is your primary console for running commands manually on the left, and a console running grunt watch on the right, allowing you to keep an eye on all of your automated tasks while you continue to work.

About: Kurt Maine

Kurt Maine is a Full-Stack Web Developer with a passion for frontend Node.js frameworks like Angular, and backend frameworks like Ruby on Rails, and the PHP framework Symfony.

Leave a Reply
