- Added feature #309, which sets the xterm title when reports are run,
  according to the configuration variable 'xterm.title', which defaults to off.
This commit is contained in:
Paul Beckingham
2011-01-08 11:30:58 -05:00
parent 0c05069baf
commit 8d4deda2bb
6 changed files with 21 additions and 0 deletions

View File

@@ -84,6 +84,7 @@ std::string Config::defaults =
"undo.style=side # Undo style - can be 'side', or 'diff'\n"
"burndown.bias=0.666 # Weighted mean bias toward recent data\n"
"regex=no # Assume all search/filter strings are regexes\n"
"xterm.title=no # Sets xterm title for some commands\n"
"\n"
"# Dates\n"
"dateformat=m/d/Y # Preferred input and display date format\n"

View File

@@ -206,6 +206,17 @@ int Context::dispatch (std::string &out)
hooks.trigger ("pre-dispatch");
// For read-only commands, optionally update the xterm window title.
// Why just the read-only commands? Because this capability is to answer the
// question of 'what did I just do to generate this outout?'.
if (config.getBoolean ("xterm.title") &&
cmd.isReadOnlyCommand ())
{
std::string title;
join (title, " ", args);
std::cout << "]0;task " << title << "" << std::endl;
}
// TODO Just look at this thing. It cries out for a dispatch table.
if (cmd.command == "projects") { rc = handleProjects (out); }
else if (cmd.command == "tags") { rc = handleTags (out); }

View File

@@ -1158,6 +1158,7 @@ int handleShow (std::string& outs)
"active.indicator tag.indicator recurrence.indicator recurrence.limit "
"list.all.projects list.all.tags undo.style verbose rule.precedence.color "
"merge.autopush merge.default.uri pull.default.uri push.default.uri "
"xterm.title "
#ifdef FEATURE_SHELL
"shell.prompt "
#endif