ConEmu’s Tasks

ConEmu’s ‘Tasks’ are used to store predefined commands or shell’s command lines. Run them anytime later by name or hotkey.

Also it’s a simple way to start several shells in tabs or splits.

ConEmu's tasks dropdown

Tasks may be configured in the ‘Settings’ dialog.

Tasks in details

ConEmu-Maximus5 is a terminal or a kind of container for whatever programs you might want to run inside it: console applications or simple programs with self graphical interface (ChildGui). They are typically a shells like cmd.exe, bash.exe, powershell.exe, editors like notepad++ or even another terminals like mintty.exe or PuTTY.exe.

And ConEmu has tabs and splittings (à la screen/tmux, but handled at the GUI level). So you can have different programs running in each of those ‘slots’.

A ‘task’ is an instruction what and how ConEmu must run in ‘slots’.

  • Each ‘task’ has a ‘name’;
  • one or several actual commands to run;
  • ‘hotkey’ to run task which is available when ConEmu has focus;
  • some optional switches like startup directory or icon.
Value Example
task name {Git Bash}, {WinSDK v7.0}, …
name or full path to program bash.exe
program arguments --login -i
-new_console switch(es) -new_console:t:"Bash" -new_console:d:"C:\Projects"
several tabs or splits cmd
powershell -new_console:sV

When you need to create a tab you may type may be long and full command line like

set "FARHOME=" & C:\Far\Far.exe /w /x /p%ConEmuDir%\Plugins\ConEmu;%FARHOME%\Plugins;C:\Far\Plugins.My

Or just run task named {Far}.

At last, Tasks are the only easy way to run several tabs or preconfigured splits at once.

A little from Settings

ConEmu settings, Tasks page

Here you can configure a list of common tasks. In fact, this is an alias to run one or more applications in new tabs within ConEmu. These can be configured in the ‘Tasks’ page of the ‘Settings’ dialog, and stored in the “Tasks” subkey of reg/xml settings. ‘Tasks’ may be used as follows (as an example, we will use a task named {Shells}):

  • when you start by specifying the properties of the shortcut: “ConEmu.exe / cmd {Shells}”;
  • specifying {Shells} in the ‘Command line’ page ‘Main’ of ‘Settings’ dialog;
  • when you create a new console interface ConEmu ([+] on the toolbar, a list of Recreate-dialog);
  • from the command line (cmd.exe): “%ConEmuBaseDir%\ConEmuC.exe” / c {Shells} -new_console.
  • from the command line (far.exe): conemu:run:{Shells} -new_console

The ConEmu Jump list is set here too. Set up a list of tasks in the field of «ConEmu arguments for Jump list» You can optionally specify the icon that is displayed in the Jump list, for example

/icon "cmd.exe"

and working directory, where new process will be started, for example

/dir "c:\Program Files"

NB Switches /icon and /dir must be typed in the ‘Task parameters’ field, but not in ‘Commands’. If you run several shells from one task, you may specify icons and working directories for each shell using -new_console switches in the ‘Commands’ box.

Tasks in Windows 7 task bar jump list

Ensure that option ‘Taskbar jump lists’ is checked, and go to Settings/Task bar. Check there ‘Add ConEmu tasks to taskbar’ and (optionally) ‘Add commands from history, too’. Than press ‘Update Now!’ button.

On success, you’ll see the message ‘Taskbar jump list was updated successfully’, or an error information. Also, you may initialize Jump list on ConEmu startup (automate your box setup), just run (once) ConEmu.exe /updatejumplist.

Creating new task

When you want to create new task absent in the default tasks list you need to know:

  • The shell name. For example: cmd, powershell, bash and so on.
  • The shell arguments. For example: cmd /k vcvarsall.bat x86
  • Shell working directory. That may be very significant.
  • In some cases you need to know environment variables.

Where you may get required information?

In most cases you may open properties of shortcut created by any installer. Just find the shortcut, right-click it, and choose ‘Properties’.

VS tools prompt

  • Copy ‘Target’ contents to the ‘Task Commands’;
  • Optionally set working directory with /dir switch in the ‘Task parameters’;
  • If you want to choose specific tab name use -new_console:t:”VS 12.0” switch;
  • Finally, if you need to define some environment variables, just specify them before the shell.
set Var1=Value1 & set "Var2=Value with spaces" & cmd /k vcvarsall.bat x86 -new_console:t:"VS 12.0"

Finally, the task for VS prompt is ready.

ConEmu VS tools prompt

If there is no shortcut for that shell

Sometimes, if the shell is started from another program you may use ProcessExplorer or ProcessMonitor to detect which command is started, arguments and the working directory.

If you can’t do that, just google for alternatives. For example it is hard to find proper arguments for NuGet console started from Visual Studio because VS do not start powershell.exe but run powershell host internally. Just google! For example:

Add default tasks

In case you have installed new application (for example new Visual Studio version) the new task is not created automatically by ConEmu without user’s request.

Just open ‘Tasks’ settings page and press ‘Add default tasks…’ button. ConEmu will confirm the action (‘Yes’ - add missed tasks; ‘No’ - rewrite existing tasks with defaults) and you will get new tasks at the end of the Tasks list!