mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-19 00:43:07 +02:00
Configuration
- The old 'curses' configuration variable is now replaced by 'detection', and has the same meaning - whether or not to auto-detect terminal size.
This commit is contained in:
parent
df41ea9988
commit
585151f184
7 changed files with 24 additions and 21 deletions
|
@ -12,6 +12,8 @@
|
|||
+ Corrected sorting to use std::stable_sort instead of std::sort, which is not
|
||||
guaranteed stable (thanks to Stefan Hacker).
|
||||
+ Enhanced diagnostics command.
|
||||
+ The old 'curses' configuration variable is now replaced by 'detection', and
|
||||
has the same meaning - whether or not to auto-detect terminal size.
|
||||
|
||||
# Tracked Features, sorted by ID.
|
||||
+ Added feature #700, which adds tab-completion of built-in tags.
|
||||
|
|
|
@ -155,15 +155,16 @@ as this significantly affects performance.
|
|||
|
||||
.SS TERMINAL
|
||||
.TP
|
||||
.B curses=on
|
||||
Determines whether to use ncurses to establish the size of the window you are
|
||||
.B detection=on
|
||||
Determines whether to use ioctl to establish the size of the window you are
|
||||
using, for text wrapping.
|
||||
|
||||
.TP
|
||||
.B defaultwidth=80
|
||||
The width of tables used when ncurses support is not available. Defaults to 80.
|
||||
If set to 0, is interpreted as infinite width, therefore with no word-wrapping;
|
||||
useful when redirecting report output to a file for subsequent manipulation.
|
||||
The width of output used when auto-detection support is not available. Defaults
|
||||
to 80. If set to 0, is interpreted as infinite width, therefore with no
|
||||
word-wrapping; useful when redirecting report output to a file for subsequent
|
||||
manipulation.
|
||||
|
||||
.TP
|
||||
.B editor=vi
|
||||
|
|
|
@ -21,7 +21,7 @@ syn match taskrcVal ".\{-}$" contains=taskrcComment
|
|||
syn match taskrcEqual "="
|
||||
syn match taskrcKey "^\s*.\{-}="he=e-1 contains=taskrcEqual
|
||||
|
||||
syn keyword taskrcGoodKey locking curses confirmation next bulk nag weekstart displayweeknumber defaultwidth editor monthsperline annotations _forcecolor blanklines debug hooks fontunderline
|
||||
syn keyword taskrcGoodKey locking detection confirmation next bulk nag weekstart displayweeknumber defaultwidth editor monthsperline annotations _forcecolor blanklines debug hooks fontunderline
|
||||
|
||||
syn match taskrcGoodKey "\(active\|tag\|recurrence\)\.indicator"
|
||||
syn match taskrcGoodKey "alias\.\S\{-}="he=e-1
|
||||
|
|
|
@ -63,7 +63,7 @@ std::string Config::defaults =
|
|||
"gc=on # Garbage-collect data files - DO NOT CHANGE unless you are sure\n"
|
||||
"\n"
|
||||
"# Terminal\n"
|
||||
"curses=on # Detects terminal width\n"
|
||||
"detection=on # Detects terminal width\n"
|
||||
"defaultwidth=80 # Without detection, assumed width\n"
|
||||
"#editor=vi # Preferred text editor\n"
|
||||
"edit.verbose=yes # Include comments in files created during task edit\n"
|
||||
|
|
|
@ -136,10 +136,10 @@ void Context::initialize ()
|
|||
loadCorrectConfigFile ();
|
||||
loadAliases ();
|
||||
|
||||
// When redirecting output to a file, do not use color, curses.
|
||||
// When redirecting output to a file, do not use color.
|
||||
if (!isatty (fileno (stdout)))
|
||||
{
|
||||
config.set ("curses", "off");
|
||||
config.set ("detection", "off");
|
||||
|
||||
if (! config.getBoolean ("_forcecolor"))
|
||||
config.set ("color", "off");
|
||||
|
@ -346,7 +346,7 @@ void Context::shadow ()
|
|||
throw std::string ("Configuration variable 'shadow.file' is set to "
|
||||
"overwrite your undo log. Please change it.");
|
||||
|
||||
std::string oldCurses = config.get ("curses");
|
||||
std::string oldDetection = config.get ("detection");
|
||||
std::string oldColor = config.get ("color");
|
||||
|
||||
clear ();
|
||||
|
@ -360,8 +360,8 @@ void Context::shadow ()
|
|||
split (args, command, ' ');
|
||||
|
||||
initialize ();
|
||||
config.set ("curses", "off");
|
||||
config.set ("color", "off");
|
||||
config.set ("detection", "off");
|
||||
config.set ("color", "off");
|
||||
|
||||
parse ();
|
||||
std::string result;
|
||||
|
@ -375,8 +375,8 @@ void Context::shadow ()
|
|||
else
|
||||
throw std::string ("Could not write file '") + shadowFile.data + "'";
|
||||
|
||||
config.set ("curses", oldCurses);
|
||||
config.set ("color", oldColor);
|
||||
config.set ("detection", oldDetection);
|
||||
config.set ("color", oldColor);
|
||||
|
||||
// Optionally display a notification that the shadow file was updated.
|
||||
if (config.getBoolean ("shadow.notify"))
|
||||
|
|
|
@ -1169,11 +1169,11 @@ int handleShow (std::string& outs)
|
|||
"color.calendar.weekend color.calendar.holiday color.calendar.weeknumber "
|
||||
"color.summary.background color.summary.bar color.history.add "
|
||||
"color.history.done color.history.delete color.undo.before "
|
||||
"color.sync.added color.sync.changed color.sync.rejected "
|
||||
"color.undo.after confirmation curses data.location dateformat "
|
||||
"dateformat.holiday dateformat.report dateformat.annotation debug "
|
||||
"default.command default.due default.priority default.project defaultwidth due "
|
||||
"dependency.confirmation dependency.reminder locale displayweeknumber "
|
||||
"color.sync.added color.sync.changed color.sync.rejected color.undo.after "
|
||||
"confirmation data.location dateformat dateformat.holiday "
|
||||
"dateformat.report dateformat.annotation debug default.command default.due "
|
||||
"default.priority default.project defaultwidth due "
|
||||
"dependency.confirmation dependency.reminder detection locale displayweeknumber "
|
||||
"export.ical.class echo.command fontunderline gc locking monthsperline "
|
||||
"nag next journal.time journal.time.start.annotation journal.info "
|
||||
"journal.time.stop.annotation project shadow.command shadow.file "
|
||||
|
|
|
@ -55,7 +55,7 @@ int Context::getWidth ()
|
|||
if (width == 0)
|
||||
return 65536;
|
||||
|
||||
if (config.getBoolean ("curses"))
|
||||
if (config.getBoolean ("detection"))
|
||||
{
|
||||
if (terminal_width == 0 &&
|
||||
terminal_height == 0)
|
||||
|
@ -83,7 +83,7 @@ int Context::getHeight ()
|
|||
{
|
||||
int height = 24;
|
||||
|
||||
if (config.getBoolean ("curses"))
|
||||
if (config.getBoolean ("detection"))
|
||||
{
|
||||
if (terminal_width == 0 &&
|
||||
terminal_height == 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue