- Fixed bug #511, which caused display problem on Cygwin when colored output
  used the full width of the terminal.  The 'avoidlastcolumn' configuration
  variable forces taskwarrior to never use the last column.
This commit is contained in:
Paul Beckingham 2011-05-30 10:21:50 -04:00
parent a1dee148b4
commit 0f5a4434ff
5 changed files with 20 additions and 4 deletions

View file

@ -52,6 +52,9 @@
Cech). Cech).
# Tracked Bugs, sorted by ID. # Tracked Bugs, sorted by ID.
+ Fixed bug #511, which caused display problem on Cygwin when colored output
used the full width of the terminal. The 'avoidlastcolumn' configuration
variable forces taskwarrior to never use the last column.
+ Fixed bug #594, which broke the 'all' report with a combination of bad regex + Fixed bug #594, which broke the 'all' report with a combination of bad regex
handling and a formatting bug (thanks to Steve Rader). handling and a formatting bug (thanks to Steve Rader).
+ Fixed bug #605, which gave misleading project completion percentages under + Fixed bug #605, which gave misleading project completion percentages under

View file

@ -166,6 +166,12 @@ 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 word-wrapping; useful when redirecting report output to a file for subsequent
manipulation. manipulation.
.TP
.B avoidlastcolumn=no
Causes the width of the terminal minus one to be used as the full width. This
avoids placing color codes in the last column which can cause problems for
Cygwin users. Default value is 'no'.
.TP .TP
.B editor=vi .B editor=vi
Specifies which text editor you wish to use for when the Specifies which text editor you wish to use for when the

View file

@ -65,6 +65,7 @@ std::string Config::defaults =
"# Terminal\n" "# Terminal\n"
"detection=on # Detects terminal width\n" "detection=on # Detects terminal width\n"
"defaultwidth=80 # Without detection, assumed width\n" "defaultwidth=80 # Without detection, assumed width\n"
"avoidlastcolumn=no # Fixes Cygwin width problem\n"
"#editor=vi # Preferred text editor\n" "#editor=vi # Preferred text editor\n"
"edit.verbose=yes # Include comments in files created during task edit\n" "edit.verbose=yes # Include comments in files created during task edit\n"
"\n" "\n"

View file

@ -67,10 +67,10 @@ int CmdShow::execute (const std::string&, std::string& output)
// Note that there is a leading and trailing space, to make it easier to // Note that there is a leading and trailing space, to make it easier to
// search for whole words. // search for whole words.
std::string recognized = std::string recognized =
" annotations bulk burndown.bias calendar.details calendar.details.report " " annotations avoidlastcolumn bulk burndown.bias calendar.details "
"calendar.holidays calendar.legend color calendar.offset " "calendar.details.report calendar.holidays calendar.legend color "
"calendar.offset.value color.active color.due color.due.today " "calendar.offset calendar.offset.value color.active color.due "
"color.blocked color.burndown.done color.burndown.pending " "color.due.today color.blocked color.burndown.done color.burndown.pending "
"color.burndown.started color.overdue color.pri.H color.pri.L color.pri.M " "color.burndown.started color.overdue color.pri.H color.pri.L color.pri.M "
"color.pri.none color.recurring color.tagged color.footnote color.header " "color.pri.none color.recurring color.tagged color.footnote color.header "
"color.debug color.alternate color.calendar.today color.calendar.due " "color.debug color.alternate color.calendar.today color.calendar.due "

View file

@ -61,6 +61,12 @@ int Context::getWidth ()
} }
width = terminal_width; width = terminal_width;
// Ncurses does this, and perhaps we need to as well, to avoid a problem on
// Cygwin where the display goes right up to the terminal width, and causes
// and odd color wrapping problem.
if (config.getBoolean ("avoidlastcolumn"))
--width;
} }
return width; return width;