Enhancement - debug mode
- Added terminal width determination in debug mode.
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//#include <iostream>
|
||||
#include <sstream>
|
||||
//#include <pwd.h>
|
||||
//#include <stdlib.h>
|
||||
//#include <string.h>
|
||||
@@ -130,13 +131,23 @@ int Context::getWidth ()
|
||||
{
|
||||
// Determine window size, and set table accordingly.
|
||||
int width = config.get ("defaultwidth", (int) 80);
|
||||
|
||||
#ifdef HAVE_LIBNCURSES
|
||||
if (config.get ("curses", true))
|
||||
{
|
||||
WINDOW* w = initscr ();
|
||||
width = w->_maxx + 1;
|
||||
endwin ();
|
||||
|
||||
std::stringstream out;
|
||||
out << "Context::getWidth: ncurses determined width of " << width << " characters";
|
||||
debug (out.str ());
|
||||
}
|
||||
else
|
||||
debug ("Context::getWidth: ncurses available but disabled.");
|
||||
#else
|
||||
out << "Context::getWidth: no ncurses, using width of " << width << " characters";
|
||||
debug (out.str ());
|
||||
#endif
|
||||
|
||||
return width;
|
||||
|
||||
@@ -171,7 +171,7 @@ std::string shortUsage ()
|
||||
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 1, "task export");
|
||||
table.addCell (row, 2, "Lists all tasks as a CSV file.");
|
||||
table.addCell (row, 2, "Lists all tasks in CSV format.");
|
||||
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 1, "task color");
|
||||
|
||||
Reference in New Issue
Block a user