ConEmu’s Tasks

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

When you need to create a tab you may type long command line with dozen of switches:

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

Or just run task named {Far}.

Task is a simple way to start several shells in tabs or splits/panes.

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

ConEmu's tasks dropdown

Tasks may be configured in the ‘Settings’ dialog.

Tasks in details

A Task is an instruction or set of instructions what and how ConEmu shall run in its ‘slots’ (tabs or splits).

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’.

Task name

Each Task has a Name. For example {Far}, {Shells::cmd}, {Bash::Git Bash}, etc. Enter the name without curly braces, they are added automatically. You may access the Task either by its full name {Shells::cmd} or by a short name {cmd}, if there are not conflicts in short names.

Task commands

One or several actual commands to run, it contains: Usually you put here a name or full path to your program, e.g. bash.exe.

  • a name or full path to program, e.g. bash.exe;
  • program arguments, e.g. --login -i;
  • -new_console switch(es), e.g. -new_console:t:"Bash" -new_console:d:"C:\Projects".
  • -new_console:sV switch to run commands in panes.

Read below about creating new task commands.

Also you may put here the names of other single-command tasks. For example, my {Startup} task initializes ssh-agent and starts Far Manager at once.

> {ssh-agent}
{Far}

Task hotkey

You may assign a ‘hotkey’ to each task to have the task started in a simple keypress when ConEmu has focus.

Task parameters

This field may contain some optional switches like startup directory or icon. These switches have influence over all commands defined in the task. You may use here a subset from ConEmu command line switches:

Somewhat from Settings

ConEmu settings, Tasks page

Tasks are configured in the Settings dialog. Don’t forget to save them after changes!

Tasks may be used in the following places (as an example, we will use a task named {cmd}):

  • when you start by specifying the properties of the shortcut: ConEmu.exe -run {cmd};
  • {cmd} in the ‘Command line’ on the Startup Settings page;
  • when you create a new console in ConEmu via [+] on the toolbar;
  • from consoles started in ConEmu:
    • from cmd.exe prompt: "%ConEmuBaseDir%\ConEmuC.exe" /c {cmd} -new_console;
    • from Far Manager prompt via plugin: conemu:run:{cmd} -new_console;
    • you can’t start new consoles from WSL prompt because all commands are executed on the Linux side.

The ConEmu Jump list may be configured 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/refresh default tasks

Often the ‘Default Task’ generated by ConEmu for well known shells and toolsets is the only proper way to run your shell in ConEmu, otherwise you may get unexpected shell behavior which ConEmu can’t ‘fix’.

Please refresh your ‘Detault Tasks’ with ‘Add/recreate default tasks…’ button on the Tasks settings page.