mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Eliminated ncurses
- Removed autoconf ncurses detection. - Modified man pages. - Inserted vitapi replacement code. - Cached terminal size values for reuse. - Modified packaging info for OSX. - Removed -lncurses from unit test makefile. - Removed obsolete taskrc example. - Modified (simplified) source build instructions.
This commit is contained in:
parent
551c4b99c4
commit
c73f131f32
22 changed files with 60 additions and 654 deletions
|
@ -21,6 +21,7 @@
|
||||||
intended to help scripts that manipulate task output.
|
intended to help scripts that manipulate task output.
|
||||||
+ Added feature #567, which makes it possible to apply an offset to the first
|
+ Added feature #567, which makes it possible to apply an offset to the first
|
||||||
month to be displayed in the calendar report (thanks to Michelle Crane)
|
month to be displayed in the calendar report (thanks to Michelle Crane)
|
||||||
|
+ Eliminated dependency on ncurses.
|
||||||
+ Fixed bug #515, which displayed an incorrect message after duplicating a
|
+ Fixed bug #515, which displayed an incorrect message after duplicating a
|
||||||
non-existent task (thanks to Peter De Poorter).
|
non-existent task (thanks to Peter De Poorter).
|
||||||
+ Fixed bug #529, where the 'depends' attribute was not mentioned in the
|
+ Fixed bug #529, where the 'depends' attribute was not mentioned in the
|
||||||
|
|
1
NEWS
1
NEWS
|
@ -10,6 +10,7 @@ New Features in taskwarrior 1.9.4
|
||||||
- Added change log display to the 'info' command.
|
- Added change log display to the 'info' command.
|
||||||
- The first month in the calendar report can now be changed with an offset
|
- The first month in the calendar report can now be changed with an offset
|
||||||
value.
|
value.
|
||||||
|
- No more dependency on ncurses.
|
||||||
|
|
||||||
Please refer to the ChangeLog file for full details. There are too many to
|
Please refer to the ChangeLog file for full details. There are too many to
|
||||||
list here.
|
list here.
|
||||||
|
|
58
README.build
58
README.build
|
@ -15,15 +15,6 @@ section, which includes instructions on how to contact us for help.
|
||||||
Operating System Notes
|
Operating System Notes
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
Cygwin 1.7
|
|
||||||
Building taskwarrior on Cygwin 1.7 requires a configure option:
|
|
||||||
|
|
||||||
./configure --with-ncurses-inc=/usr/include/ncurses
|
|
||||||
|
|
||||||
This is because the ncurses include files are in a different location to
|
|
||||||
Cygwin 1.5.
|
|
||||||
|
|
||||||
|
|
||||||
Haiku Alpha/R1
|
Haiku Alpha/R1
|
||||||
Taskwarrior must be built with gcc version 4.x, so make sure you run:
|
Taskwarrior must be built with gcc version 4.x, so make sure you run:
|
||||||
|
|
||||||
|
@ -46,53 +37,12 @@ may be compiler errors and warnings when running 'make'. Sometimes you will run
|
||||||
configure with no reported problems, and the build will fail later. This is
|
configure with no reported problems, and the build will fail later. This is
|
||||||
almost always because configure is mistaken about some assumption.
|
almost always because configure is mistaken about some assumption.
|
||||||
|
|
||||||
The configure program can accept several options that help with its ability to
|
If a build does not succeed, please send the contents of the 'config.log' file
|
||||||
locate and use the ncurses library. They are:
|
to support@taskwarrior.org, or post a message in the support forums at
|
||||||
|
taskwarrior.org along with the information.
|
||||||
--with-ncurses
|
|
||||||
|
|
||||||
This option tells configure that no matter what it thinks, ncurses is
|
|
||||||
definitely on this system and should be enabled. If needed, this option
|
|
||||||
probable needs to be accompanied by the next two options.
|
|
||||||
|
|
||||||
--with-ncurses-inc=/usr/include
|
|
||||||
|
|
||||||
If configure cannot find ncurses header files, this option will tell it
|
|
||||||
exactly where to look. The path specified in this example is the default,
|
|
||||||
so that probably won't help you. The path should be the directory in which
|
|
||||||
the file 'ncurses.h' resides. Here are some possible values to try:
|
|
||||||
|
|
||||||
/usr/include (the default shown above)
|
|
||||||
/usr/include/ncurses
|
|
||||||
/usr/local/include
|
|
||||||
/usr/local/include/ncurses
|
|
||||||
|
|
||||||
This should cover most systems, but new variations keeps cropping up.
|
|
||||||
|
|
||||||
--with-ncurses-lib=/usr/lib
|
|
||||||
|
|
||||||
If configure cannot find the ncurses library, this option will tell it
|
|
||||||
exactly where to look. The path specified in this example is the default,
|
|
||||||
so that probably won't help you. The path should be the directory in which
|
|
||||||
the file 'libncurses.a' (or your system's equivalent) resides. Here are
|
|
||||||
some possible values to try:
|
|
||||||
|
|
||||||
/usr/lib
|
|
||||||
/usr/local/lib
|
|
||||||
|
|
||||||
This should cover most systems, but new variations keeps cropping up.
|
|
||||||
|
|
||||||
--without-ncurses
|
|
||||||
|
|
||||||
This disables ncurses support in taskwarrior, and should really be used as a
|
|
||||||
last resort. We know of no systems where this is needed.
|
|
||||||
|
|
||||||
If trying these options does not succeed, please send the contents of the
|
|
||||||
'config.log' files to support@taskwarrior.org, or post a message in the support
|
|
||||||
forums at taskwarrior.org along with the information.
|
|
||||||
|
|
||||||
If configure runs, but taskwarrior does not build, when ideally you would send
|
If configure runs, but taskwarrior does not build, when ideally you would send
|
||||||
both the contents of config.log, and a transcript from the build, which is not
|
both the contents of config.log, and a transcript from the build, which is not
|
||||||
written to a file, and must be captured from the terminal.
|
written to a file and must be captured from the terminal.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
31
configure.ac
31
configure.ac
|
@ -64,37 +64,6 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# ncurses enabled by default.
|
|
||||||
AC_ARG_WITH([ncurses],
|
|
||||||
[AS_HELP_STRING([--without-ncurses], [disable support for ncurses])],
|
|
||||||
[with_ncurses=no],
|
|
||||||
[with_ncurses=yes])
|
|
||||||
|
|
||||||
AC_ARG_WITH([ncurses-inc],
|
|
||||||
[AS_HELP_STRING ([--with-ncurses-inc=DIR], [ncurses include files are in DIR])],
|
|
||||||
[ncurses_inc=$withval],
|
|
||||||
[ncurses_inc=''])
|
|
||||||
|
|
||||||
AC_ARG_WITH([ncurses-lib],
|
|
||||||
[AS_HELP_STRING ([--with-ncurses-lib=DIR], [ncurses lib files are in DIR])],
|
|
||||||
[ncurses_lib=$withval],
|
|
||||||
[ncurses_lib=''])
|
|
||||||
|
|
||||||
if test "x$with_ncurses" = "xyes" ; then
|
|
||||||
AC_DEFINE([HAVE_LIBNCURSES], [1], [Defined if you have libncurses])
|
|
||||||
if test -n "$ncurses_inc"; then
|
|
||||||
CFLAGS="$CFLAGS -I$ncurses_inc"
|
|
||||||
CXXFLAGS="$CXXFLAGS -I$ncurses_inc"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -n "$ncurses_lib"; then
|
|
||||||
LDFLAGS="$LDFLAGS -L$ncurses_lib"
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_CHECK_LIB([ncurses],[main])
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Readline enabled by default.
|
# Readline enabled by default.
|
||||||
#AC_ARG_WITH([readline],
|
#AC_ARG_WITH([readline],
|
||||||
# [AS_HELP_STRING([--without-readline], [disable support for readline])],
|
# [AS_HELP_STRING([--without-readline], [disable support for readline])],
|
||||||
|
|
|
@ -61,23 +61,6 @@ automatically upgrade the file but if you need to revert to a previous version
|
||||||
of taskwarrior, there is the file format to consider. This is yet another good
|
of taskwarrior, there is the file format to consider. This is yet another good
|
||||||
reason to back up your task data files!
|
reason to back up your task data files!
|
||||||
|
|
||||||
.TP
|
|
||||||
.B Q: I'm using Ubuntu 9.04, and I want to word-wrap descriptions. How do I do this?
|
|
||||||
A: You need to install ncurses, by doing this:
|
|
||||||
|
|
||||||
% sudo apt-get install libncurses5-dev
|
|
||||||
|
|
||||||
Then you need to rebuild taskwarrior from scratch, starting with
|
|
||||||
|
|
||||||
% cd task-X.X.X
|
|
||||||
% ./configure
|
|
||||||
...
|
|
||||||
|
|
||||||
The result should be a taskwarrior program that knows the width of the terminal
|
|
||||||
window, and wraps accordingly.
|
|
||||||
|
|
||||||
Note that all the binary packages include this capability.
|
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B Q: How do I build taskwarrior under Cygwin?
|
.B Q: How do I build taskwarrior under Cygwin?
|
||||||
A: Take a look at the README.build file, where the latest information on build
|
A: Take a look at the README.build file, where the latest information on build
|
||||||
|
@ -86,15 +69,9 @@ you'll need to make sure you have the following packages available first:
|
||||||
|
|
||||||
gcc
|
gcc
|
||||||
make
|
make
|
||||||
libncurses-devel
|
|
||||||
libncurses8
|
|
||||||
|
|
||||||
The gcc and make packages allow you to compile the code, and are therefore
|
The gcc and make packages allow you to compile the code, and are therefore
|
||||||
required, but the ncurses packages are optional. Ncurses will allow taskwarrior
|
required.
|
||||||
to determine the width of the window, and therefore use the whole width and wrap
|
|
||||||
text accordingly, for a more aesthetically pleasing display.
|
|
||||||
|
|
||||||
Note that there are binary packages that all include this capability.
|
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B Q: Do colors work under Cygwin?
|
.B Q: Do colors work under Cygwin?
|
||||||
|
|
|
@ -378,7 +378,7 @@ Specifies background color.
|
||||||
Specifies the desired number of tasks a report should show, if a positive
|
Specifies the desired number of tasks a report should show, if a positive
|
||||||
integer is given. The value 'page' may also be used, and will limit the
|
integer is given. The value 'page' may also be used, and will limit the
|
||||||
report output to as many lines of text as will fit on screen. This defaults
|
report output to as many lines of text as will fit on screen. This defaults
|
||||||
to 25 lines, if ncurses is not installed or enabled.
|
to 25 lines.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B wait:<wait-date>
|
.B wait:<wait-date>
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
105 Inverted sequence range high-low
|
105 Inverted sequence range high-low
|
||||||
106 ID Range too large
|
106 ID Range too large
|
||||||
107 Not a sequence.
|
107 Not a sequence.
|
||||||
108 Interactive mode is only available when built with ncurses support.
|
|
||||||
109 Empty record in input
|
109 Empty record in input
|
||||||
110 Unrecognized characters at end of line
|
110 Unrecognized characters at end of line
|
||||||
111 Record not recognized as format 4
|
111 Record not recognized as format 4
|
||||||
|
|
|
@ -19,11 +19,6 @@ strip the trailing \n characters from the end of the file.
|
||||||
If you must edit your pending.data file, make sure that your text editor doesn't
|
If you must edit your pending.data file, make sure that your text editor doesn't
|
||||||
convert from a Unix to a DOS file encoding.
|
convert from a Unix to a DOS file encoding.
|
||||||
%
|
%
|
||||||
Did you build task from source? If you didn't have ncurses installed at the
|
|
||||||
time, then you're missing out on text wrapping and task cannot take advantage of
|
|
||||||
the full terminal width. Consider rebuilding with ncurses installed, or install
|
|
||||||
from a pre-built package for your OS.
|
|
||||||
%
|
|
||||||
Do you have the latest version of task installed? Check http://taskwarrior.org
|
Do you have the latest version of task installed? Check http://taskwarrior.org
|
||||||
periodically for news of updates. That feature you wanted might be ready...
|
periodically for news of updates. That feature you wanted might be ready...
|
||||||
%
|
%
|
||||||
|
|
|
@ -75,11 +75,11 @@ Note: This is being written from the OSX 10.6 perspective, and may therefore
|
||||||
|
|
||||||
Any text editor will do, but look for this line (line 5):
|
Any text editor will do, but look for this line (line 5):
|
||||||
|
|
||||||
LFLAGS = -L/usr/local/lib -lncurses -llua
|
LFLAGS = -L/usr/local/lib -llua
|
||||||
|
|
||||||
and change it to:
|
and change it to:
|
||||||
|
|
||||||
LFLAGS = -L/usr/local/lib -lncurses
|
LFLAGS = -L/usr/local/lib
|
||||||
|
|
||||||
Now build the unit tests:
|
Now build the unit tests:
|
||||||
|
|
||||||
|
@ -256,7 +256,7 @@ Note: This is being written from the OSX 10.6 perspective, and may therefore
|
||||||
|
|
||||||
$ /usr/local/bin/task version
|
$ /usr/local/bin/task version
|
||||||
|
|
||||||
task 1.9.2 built for darwin-ncurses
|
task 1.9.2 built for darwin
|
||||||
Copyright (C) 2006 - 2010 P. Beckingham, F. Hernandez.
|
Copyright (C) 2006 - 2010 P. Beckingham, F. Hernandez.
|
||||||
|
|
||||||
Taskwarrior may be copied only under the terms of the GNU General Public
|
Taskwarrior may be copied only under the terms of the GNU General Public
|
||||||
|
|
|
@ -115,13 +115,6 @@ static int api_task_feature (lua_State* L)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (name == "ncurses")
|
|
||||||
{
|
|
||||||
#ifdef HAVE_NCURSES
|
|
||||||
value = true;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (name == "lua")
|
else if (name == "lua")
|
||||||
value = true;
|
value = true;
|
||||||
|
|
||||||
|
|
|
@ -63,8 +63,8 @@ std::string Config::defaults =
|
||||||
"gc=on # Garbage-collect data files - DO NOT CHANGE unless you are sure\n"
|
"gc=on # Garbage-collect data files - DO NOT CHANGE unless you are sure\n"
|
||||||
"\n"
|
"\n"
|
||||||
"# Terminal\n"
|
"# Terminal\n"
|
||||||
"curses=on # Use ncurses library to determine terminal width\n"
|
"curses=on # Detects terminal width\n"
|
||||||
"defaultwidth=80 # Without ncurses, assumed width\n"
|
"defaultwidth=80 # Without detection, assumed width\n"
|
||||||
"#editor=vi # Preferred text editor\n"
|
"#editor=vi # Preferred text editor\n"
|
||||||
"\n"
|
"\n"
|
||||||
"# Miscellaneous\n"
|
"# Miscellaneous\n"
|
||||||
|
|
|
@ -56,6 +56,8 @@ Context::Context ()
|
||||||
, var_overrides ("")
|
, var_overrides ("")
|
||||||
, cmd ()
|
, cmd ()
|
||||||
, inShadow (false)
|
, inShadow (false)
|
||||||
|
, terminal_width (0)
|
||||||
|
, terminal_height (0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -99,6 +99,9 @@ public:
|
||||||
std::vector <std::string> footnotes;
|
std::vector <std::string> footnotes;
|
||||||
std::vector <std::string> debugMessages;
|
std::vector <std::string> debugMessages;
|
||||||
bool inShadow;
|
bool inShadow;
|
||||||
|
|
||||||
|
int terminal_width;
|
||||||
|
int terminal_height;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -45,10 +45,6 @@
|
||||||
#include "../auto.h"
|
#include "../auto.h"
|
||||||
#include "Transport.h"
|
#include "Transport.h"
|
||||||
|
|
||||||
#ifdef HAVE_LIBNCURSES
|
|
||||||
#include <ncurses.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern Context context;
|
extern Context context;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -836,10 +832,6 @@ int handleVersion (std::string& outs)
|
||||||
<< "unknown"
|
<< "unknown"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_LIBNCURSES
|
|
||||||
<< "-ncurses"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBREADLINE
|
#ifdef HAVE_LIBREADLINE
|
||||||
<< "-readline"
|
<< "-readline"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -43,10 +43,6 @@
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
#ifdef HAVE_LIBNCURSES
|
|
||||||
#include <ncurses.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern Context context;
|
extern Context context;
|
||||||
static std::vector <std::string> customReports;
|
static std::vector <std::string> customReports;
|
||||||
|
|
||||||
|
|
16
src/diag.cpp
16
src/diag.cpp
|
@ -47,10 +47,6 @@ extern "C"
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_LIBNCURSES
|
|
||||||
#include <ncurses.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern Context context;
|
extern Context context;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -118,18 +114,6 @@ void handleDiagnostics (std::string& outs)
|
||||||
|
|
||||||
std::cout << "[1mLibraries[0m\n";
|
std::cout << "[1mLibraries[0m\n";
|
||||||
|
|
||||||
// NCurses.
|
|
||||||
std::cout << " NCurses: "
|
|
||||||
#ifdef HAVE_LIBNCURSES
|
|
||||||
<< NCURSES_VERSION
|
|
||||||
<< " ("
|
|
||||||
<< NCURSES_VERSION_PATCH
|
|
||||||
<< ")"
|
|
||||||
#else
|
|
||||||
<< "n/a"
|
|
||||||
#endif
|
|
||||||
<< "\n";
|
|
||||||
|
|
||||||
std::cout << " Readline: "
|
std::cout << " Readline: "
|
||||||
#ifdef HAVE_LIBREADLINE
|
#ifdef HAVE_LIBREADLINE
|
||||||
<< std::setbase (16) << RL_READLINE_VERSION
|
<< std::setbase (16) << RL_READLINE_VERSION
|
||||||
|
|
|
@ -28,7 +28,8 @@
|
||||||
//#include <iostream>
|
//#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
//#include <pwd.h>
|
//#include <pwd.h>
|
||||||
//#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <sys/ioctl.h>
|
||||||
//#include <stdlib.h>
|
//#include <stdlib.h>
|
||||||
//#include <string.h>
|
//#include <string.h>
|
||||||
#include "Context.h"
|
#include "Context.h"
|
||||||
|
@ -38,134 +39,41 @@
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
#include "../auto.h"
|
#include "../auto.h"
|
||||||
|
|
||||||
#ifdef HAVE_LIBNCURSES
|
|
||||||
#include <ncurses.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
int Context::interactive ()
|
int Context::interactive ()
|
||||||
{
|
{
|
||||||
#ifdef HAVE_LIBNCURSES
|
|
||||||
|
|
||||||
// TODO init ncurses
|
|
||||||
// TODO create worker thread
|
|
||||||
// TODO create refresh thread
|
|
||||||
|
|
||||||
// TODO join refresh thread
|
|
||||||
// TODO join worker thread
|
|
||||||
// TODO take down ncurses
|
|
||||||
|
|
||||||
// throw std::string ("unimplemented Context::interactive");
|
|
||||||
|
|
||||||
// Fake interactive teaser...
|
|
||||||
#ifdef FEATURE_NCURSES_COLS
|
|
||||||
initscr ();
|
|
||||||
int width = COLS;
|
|
||||||
int height = LINES;
|
|
||||||
#else
|
|
||||||
WINDOW* w = initscr ();
|
|
||||||
int width = w->_maxx + 1;
|
|
||||||
int height = w->_maxy + 1;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
(void) nonl ();
|
|
||||||
(void) cbreak ();
|
|
||||||
|
|
||||||
start_color ();
|
|
||||||
init_pair (1, COLOR_WHITE, COLOR_BLUE);
|
|
||||||
init_pair (2, COLOR_WHITE, COLOR_RED);
|
|
||||||
init_pair (3, COLOR_CYAN, COLOR_BLUE);
|
|
||||||
|
|
||||||
// Process commands.
|
|
||||||
std::string command = "";
|
|
||||||
int c;
|
|
||||||
while (command != "quit")
|
|
||||||
{
|
|
||||||
// Render title.
|
|
||||||
std::string title = "taskwarrior 3.0.0";
|
|
||||||
while ((int) title.length () < width)
|
|
||||||
title += " ";
|
|
||||||
|
|
||||||
bkgdset (COLOR_PAIR (1));
|
|
||||||
mvprintw (0, 0, title.c_str ());
|
|
||||||
|
|
||||||
bkgdset (COLOR_PAIR (2));
|
|
||||||
int line = height / 2;
|
|
||||||
mvprintw (line, width / 2 - 24, " I n t e r a c t i v e t a s k w a r r i o r ");
|
|
||||||
mvprintw (line + 1, width / 2 - 24, " Coming in version 3.0.0 ");
|
|
||||||
|
|
||||||
std::string footer = "Press 'q' to quit.";
|
|
||||||
while ((int) footer.length () < width)
|
|
||||||
footer = " " + footer;
|
|
||||||
|
|
||||||
bkgdset (COLOR_PAIR (3));
|
|
||||||
mvprintw (height - 1, 0, footer.c_str ());
|
|
||||||
|
|
||||||
move (1, 0);
|
|
||||||
refresh ();
|
|
||||||
|
|
||||||
if ((c = getch ()) != ERR)
|
|
||||||
{
|
|
||||||
// 'Esc' and 'Enter' clear the accumulated commands.
|
|
||||||
// TODO Looks like \n is not preserved by getch.
|
|
||||||
if (c == 033 || c == '\n')
|
|
||||||
{
|
|
||||||
command = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (c == 'q')
|
|
||||||
{
|
|
||||||
command = "quit";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
endwin ();
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
throw stringtable.get (INTERACTIVE_NO_NCURSES,
|
|
||||||
"Interactive taskwarrior is only available when built "
|
|
||||||
"with ncurses support.");
|
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
int Context::getWidth ()
|
int Context::getWidth ()
|
||||||
{
|
{
|
||||||
// Determine window size, and set table accordingly.
|
// Determine window size.
|
||||||
int width = config.getInteger ("defaultwidth");
|
int width = config.getInteger ("defaultwidth");
|
||||||
|
|
||||||
#ifdef HAVE_LIBNCURSES
|
|
||||||
if (config.getBoolean ("curses"))
|
|
||||||
{
|
|
||||||
#ifdef FEATURE_NCURSES_COLS
|
|
||||||
initscr ();
|
|
||||||
width = COLS;
|
|
||||||
#else
|
|
||||||
WINDOW* w = initscr ();
|
|
||||||
width = w->_maxx + 1;
|
|
||||||
#endif
|
|
||||||
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
|
|
||||||
std::stringstream out;
|
|
||||||
out << "Context::getWidth: no ncurses, using width of " << width << " characters";
|
|
||||||
debug (out.str ());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// A zero width value means 'infinity', which is approximated here by 2^16.
|
// A zero width value means 'infinity', which is approximated here by 2^16.
|
||||||
if (width == 0)
|
if (width == 0)
|
||||||
width = 65536;
|
return 65536;
|
||||||
|
|
||||||
|
if (config.getBoolean ("curses"))
|
||||||
|
{
|
||||||
|
if (terminal_width == 0 &&
|
||||||
|
terminal_height == 0)
|
||||||
|
{
|
||||||
|
unsigned short buff[4];
|
||||||
|
if (ioctl (fileno(stdout), TIOCGWINSZ, &buff) != -1)
|
||||||
|
{
|
||||||
|
terminal_height = buff[0];
|
||||||
|
terminal_width = buff[1];
|
||||||
|
|
||||||
|
std::stringstream out;
|
||||||
|
out << "Context::getWidth: determined width of " << width << " characters";
|
||||||
|
debug (out.str ());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
width = terminal_width;
|
||||||
|
}
|
||||||
|
|
||||||
return width;
|
return width;
|
||||||
}
|
}
|
||||||
|
@ -173,32 +81,27 @@ int Context::getWidth ()
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
int Context::getHeight ()
|
int Context::getHeight ()
|
||||||
{
|
{
|
||||||
// Determine window size, and set table accordingly.
|
int height = 24;
|
||||||
int height = 25; // TODO Is there a better number?
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBNCURSES
|
|
||||||
if (config.getBoolean ("curses"))
|
if (config.getBoolean ("curses"))
|
||||||
{
|
{
|
||||||
#ifdef FEATURE_NCURSES_COLS
|
if (terminal_width == 0 &&
|
||||||
initscr ();
|
terminal_height == 0)
|
||||||
height = LINES;
|
{
|
||||||
#else
|
unsigned short buff[4];
|
||||||
WINDOW* w = initscr ();
|
if (ioctl (fileno(stdout), TIOCGWINSZ, &buff) != -1)
|
||||||
height = w->_maxy + 1;
|
{
|
||||||
#endif
|
terminal_height = buff[0];
|
||||||
endwin ();
|
terminal_width = buff[1];
|
||||||
|
|
||||||
std::stringstream out;
|
std::stringstream out;
|
||||||
out << "Context::getHeight: ncurses determined height of " << height << " characters";
|
out << "Context::getWidth: determined height of " << terminal_height << " characters";
|
||||||
debug (out.str ());
|
debug (out.str ());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
height = terminal_height;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
debug ("Context::getHeight: ncurses available but disabled.");
|
|
||||||
#else
|
|
||||||
std::stringstream out;
|
|
||||||
out << "Context::getHeight: no ncurses, using height of " << height << " characters";
|
|
||||||
debug (out.str ());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return height;
|
return height;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,10 +44,6 @@
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
#ifdef HAVE_LIBNCURSES
|
|
||||||
#include <ncurses.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Global context for use by all.
|
// Global context for use by all.
|
||||||
extern Context context;
|
extern Context context;
|
||||||
|
|
||||||
|
|
|
@ -47,10 +47,6 @@
|
||||||
#include <util.h>
|
#include <util.h>
|
||||||
#include <main.h>
|
#include <main.h>
|
||||||
|
|
||||||
#ifdef HAVE_LIBNCURSES
|
|
||||||
#include <ncurses.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void countTasks (const std::vector <Task>&, const std::string&, const std::string&, int&, int&);
|
static void countTasks (const std::vector <Task>&, const std::string&, const std::string&, int&, int&);
|
||||||
|
|
||||||
extern Context context;
|
extern Context context;
|
||||||
|
|
|
@ -3,7 +3,7 @@ PROJECT = t.t tdb.t date.t duration.t t.benchmark.t text.t autocomplete.t \
|
||||||
cmd.t util.t color.t list.t path.t file.t directory.t grid.t rx.t \
|
cmd.t util.t color.t list.t path.t file.t directory.t grid.t rx.t \
|
||||||
taskmod.t sensor.t rectangle.t tree.t tree2.t lisp.t uri.t
|
taskmod.t sensor.t rectangle.t tree.t tree2.t lisp.t uri.t
|
||||||
CFLAGS = -I. -I.. -I../.. -Wall -pedantic -ggdb3 -fno-rtti
|
CFLAGS = -I. -I.. -I../.. -Wall -pedantic -ggdb3 -fno-rtti
|
||||||
LFLAGS = -L/usr/local/lib -lpthread -lncurses -llua
|
LFLAGS = -L/usr/local/lib -lpthread -llua
|
||||||
OBJECTS = ../t-TDB.o ../t-Task.o ../t-text.o ../t-Date.o ../t-Table.o \
|
OBJECTS = ../t-TDB.o ../t-Task.o ../t-text.o ../t-Date.o ../t-Table.o \
|
||||||
../t-Duration.o ../t-util.o ../t-Config.o ../t-Sequence.o ../t-Att.o \
|
../t-Duration.o ../t-util.o ../t-Config.o ../t-Sequence.o ../t-Att.o \
|
||||||
../t-Cmd.o ../t-Record.o ../t-StringTable.o ../t-Subst.o \
|
../t-Cmd.o ../t-Record.o ../t-StringTable.o ../t-Subst.o \
|
||||||
|
|
348
taskrc
348
taskrc
|
@ -1,348 +0,0 @@
|
||||||
# Sample .taskrc file to be auto-generated.
|
|
||||||
|
|
||||||
### header
|
|
||||||
title
|
|
||||||
# .taskrc - taskwarrior configuration file
|
|
||||||
|
|
||||||
date/ version of taskwarrior
|
|
||||||
# Nov 23 - 1.8.4
|
|
||||||
|
|
||||||
cautions
|
|
||||||
# back up this file, if making significant changes
|
|
||||||
# use a text editor, not a word processor
|
|
||||||
# spaces or special charachters must be escaped "/" or contained in quotes "
|
|
||||||
|
|
||||||
instructions
|
|
||||||
# name=value
|
|
||||||
# replace "foo"
|
|
||||||
# respect processing order (downward)
|
|
||||||
# comment character
|
|
||||||
# using folding in vim
|
|
||||||
|
|
||||||
where to look for help
|
|
||||||
# task version command displays current settings
|
|
||||||
# taskwarrior.org/rc
|
|
||||||
|
|
||||||
### applications
|
|
||||||
browser=elinks
|
|
||||||
editor=vim
|
|
||||||
emailclient=sup
|
|
||||||
printer=lpr
|
|
||||||
terminal=xterm
|
|
||||||
|
|
||||||
### colors.panels
|
|
||||||
# alternate.colors.panels=bright #over-rides the following
|
|
||||||
# panel.border.width=0 # pixels
|
|
||||||
# color.panel.border=
|
|
||||||
color.panel.appname=
|
|
||||||
color.panel.clock=
|
|
||||||
color.panel.completed=
|
|
||||||
color.panel.date=
|
|
||||||
color.panel.header=
|
|
||||||
color.panel.included=
|
|
||||||
color.panel.keys=
|
|
||||||
color.panel.listing=
|
|
||||||
color.panel.notify=
|
|
||||||
color.panel.pending=
|
|
||||||
color.panel.prompt=
|
|
||||||
color.panel.searchstring=
|
|
||||||
color.panel.showing=
|
|
||||||
|
|
||||||
### colors.16.dark (used for curses interactive)
|
|
||||||
# alternate.colors.16.dark=bold16 #over-rides the following
|
|
||||||
color.active=
|
|
||||||
color.alternate.bg=
|
|
||||||
color.due=
|
|
||||||
color.footnote=
|
|
||||||
color.header=
|
|
||||||
color.history.add=
|
|
||||||
color.history.delete=
|
|
||||||
color.history.done=
|
|
||||||
# color.keyword.foo=
|
|
||||||
color.message=
|
|
||||||
color.overdue=
|
|
||||||
color.pri.H=
|
|
||||||
color.pri.L=
|
|
||||||
color.pri.M=
|
|
||||||
color.pri.none=
|
|
||||||
# color.project.foo=
|
|
||||||
color.recurring=
|
|
||||||
color.shell.bg=
|
|
||||||
color.shell.prompt=
|
|
||||||
# color.tag.foo=
|
|
||||||
# color.tagged=
|
|
||||||
|
|
||||||
### colors.16.light (used for curses interactive)
|
|
||||||
# alternate.colors.16.light=bright16 #over-rides the following
|
|
||||||
color.active=
|
|
||||||
color.alternate.bg=
|
|
||||||
color.due=
|
|
||||||
color.footnote=
|
|
||||||
color.header=
|
|
||||||
color.history.add=
|
|
||||||
color.history.delete=
|
|
||||||
color.history.done=
|
|
||||||
# color.keyword.foo=
|
|
||||||
color.message=
|
|
||||||
color.overdue=
|
|
||||||
color.pri.H=
|
|
||||||
color.pri.L=
|
|
||||||
color.pri.M=
|
|
||||||
color.pri.none=
|
|
||||||
# color.project.foo=
|
|
||||||
color.recurring=
|
|
||||||
color.shell.bg=
|
|
||||||
color.shell.prompt=
|
|
||||||
# color.tag.foo=
|
|
||||||
# color.tagged=
|
|
||||||
|
|
||||||
### colors.256.dark (used for cli)
|
|
||||||
# alternate.colors.256.dark=zen #over-rides the following
|
|
||||||
color.ui.active=
|
|
||||||
color.ui.alternate.bg=
|
|
||||||
color.ui.due=
|
|
||||||
color.ui.footnote=
|
|
||||||
color.ui.header=
|
|
||||||
color.ui.history.add=
|
|
||||||
color.ui.history.delete=
|
|
||||||
color.ui.history.done=
|
|
||||||
# color.ui.keyword.foo=
|
|
||||||
color.ui.message=
|
|
||||||
color.ui.overdue=
|
|
||||||
color.ui.pri.H=
|
|
||||||
color.ui.pri.L=
|
|
||||||
color.ui.pri.M=
|
|
||||||
color.ui.pri.none=
|
|
||||||
# color.ui.project.foo=
|
|
||||||
color.ui.recurring=
|
|
||||||
color.ui.shell.bg=
|
|
||||||
color.ui.shell.prompt=
|
|
||||||
# color.ui.tag.foo=
|
|
||||||
# color.ui.tagged=
|
|
||||||
|
|
||||||
### colors.256.light (used for cli)
|
|
||||||
# alternate.colors.256.light=zen-lite #over-rides the following
|
|
||||||
color.ui.active=
|
|
||||||
color.ui.alternate.bg=
|
|
||||||
color.ui.due=
|
|
||||||
color.ui.footnote=
|
|
||||||
color.ui.header=
|
|
||||||
color.ui.history.add=
|
|
||||||
color.ui.history.delete=
|
|
||||||
color.ui.history.done=
|
|
||||||
# color.ui.keyword.foo=
|
|
||||||
color.ui.message=
|
|
||||||
color.ui.overdue=
|
|
||||||
color.ui.pri.H=
|
|
||||||
color.ui.pri.L=
|
|
||||||
color.ui.pri.M=
|
|
||||||
color.ui.pri.none=
|
|
||||||
# color.ui.project.foo=
|
|
||||||
color.ui.recurring=
|
|
||||||
color.ui.shell.bg=
|
|
||||||
color.ui.shell.prompt=
|
|
||||||
# color.ui.tag.foo=
|
|
||||||
# color.ui.tagged=
|
|
||||||
|
|
||||||
### command aliases
|
|
||||||
alias.rm=delete
|
|
||||||
|
|
||||||
### contexts (@ key - interactive)
|
|
||||||
@home
|
|
||||||
@phone
|
|
||||||
@shopping
|
|
||||||
@work
|
|
||||||
|
|
||||||
### completion
|
|
||||||
complete.all.projects=no
|
|
||||||
complete.all.tags=no
|
|
||||||
# complete.all.desc=no
|
|
||||||
# complete.desc.file=~/.task/complete.description.txt
|
|
||||||
|
|
||||||
### data locations
|
|
||||||
.taskrc.global=/etc/
|
|
||||||
.taskrc.local=~/
|
|
||||||
.taskrc.alternate=~/alternate/
|
|
||||||
data.files=~/.task/
|
|
||||||
note.files=~/.task/notes/
|
|
||||||
plug-ins=~/.task/plug-ins/
|
|
||||||
searches=~/.task/search/
|
|
||||||
shared.files=~/.task/share/
|
|
||||||
themes=~/.task/colors/
|
|
||||||
|
|
||||||
### dates
|
|
||||||
dateformat=YYYY/MM/DD
|
|
||||||
due=7 (how manu days from now = due)
|
|
||||||
weeknumber=yes
|
|
||||||
weekstart=mon
|
|
||||||
|
|
||||||
### defaults
|
|
||||||
bulk=2 (number of tasks processed without confirmation)
|
|
||||||
# command=interactive (when run with no arguments)
|
|
||||||
locking=on
|
|
||||||
priority=M
|
|
||||||
project=
|
|
||||||
rating=3
|
|
||||||
prompt.default.action=Y # Y,N,A,Q or blank, for none
|
|
||||||
term.color=dark #dark, light
|
|
||||||
# use.terminal.title=yes
|
|
||||||
|
|
||||||
### dialogs
|
|
||||||
confirmation=yes
|
|
||||||
nag=do more !
|
|
||||||
ui.confirm.quit=no
|
|
||||||
|
|
||||||
### display
|
|
||||||
alternating.bg=yes
|
|
||||||
blanklines=on
|
|
||||||
annotations=all # all, flag, newest, none
|
|
||||||
cal=full #brief
|
|
||||||
color=on
|
|
||||||
color.keyword=word #line, word
|
|
||||||
color.project=word #line, word
|
|
||||||
color.tag=word #line, word
|
|
||||||
curses=on
|
|
||||||
default.width=100
|
|
||||||
echo.command=yes
|
|
||||||
# _forcecolor=on
|
|
||||||
initial.ui.screen=report.next
|
|
||||||
monthsperline=2
|
|
||||||
notes=flag # all, 1row, flag
|
|
||||||
pager=on # iftoolong, off
|
|
||||||
rating=* # character, number
|
|
||||||
|
|
||||||
### exclusions (will be hidden from most reports)
|
|
||||||
# due:+2m
|
|
||||||
# proj:movies
|
|
||||||
# rating:1
|
|
||||||
status=waiting
|
|
||||||
status=completed
|
|
||||||
# tag.has:personal
|
|
||||||
|
|
||||||
### export
|
|
||||||
|
|
||||||
### fullscreen - f11 (hidden panels)
|
|
||||||
keys
|
|
||||||
tips
|
|
||||||
title
|
|
||||||
clock
|
|
||||||
date
|
|
||||||
stats
|
|
||||||
|
|
||||||
### history
|
|
||||||
|
|
||||||
### import
|
|
||||||
bg=
|
|
||||||
description=
|
|
||||||
due=
|
|
||||||
end=
|
|
||||||
entry=
|
|
||||||
fg=
|
|
||||||
id=
|
|
||||||
priority=
|
|
||||||
project=
|
|
||||||
recur=
|
|
||||||
start=
|
|
||||||
status=
|
|
||||||
tags=
|
|
||||||
uuid=
|
|
||||||
|
|
||||||
### next
|
|
||||||
limit=5
|
|
||||||
|
|
||||||
### reports (map to f2 - f10)
|
|
||||||
# Fields: id,uuid,project,priority,entry,start,due,recur,age,active,tags,description
|
|
||||||
# description_only
|
|
||||||
# Description: This report is ...
|
|
||||||
# Sort: due+,priority-,project+
|
|
||||||
# Filter: pro:x pri:H +bug
|
|
||||||
# Limit: 10
|
|
||||||
|
|
||||||
# long
|
|
||||||
report.long.description=Lists all task, all data, matching the specified criteria
|
|
||||||
report.long.columns=id,priority,project,description,tags,entry,start,due,recur,age
|
|
||||||
report.long.labels=ID,Pri,Project,Description,Tags,Added,Started,Due,Recur,Age
|
|
||||||
report.long.sort=due+,priority-,project+
|
|
||||||
report.long.filter=status:pending
|
|
||||||
|
|
||||||
# list
|
|
||||||
report.list.description=Lists all tasks matching the specified criteria
|
|
||||||
report.list.columns=id,priority,description,project,tags,due
|
|
||||||
report.list.labels=ID,Pir,Description,Project,Tags,Due
|
|
||||||
report.list.sort=due+,priority-,project+
|
|
||||||
report.list.filter=status:pending
|
|
||||||
|
|
||||||
# ls
|
|
||||||
report.ls.description=Minimal listing of all tasks matching the specified criteria
|
|
||||||
report.ls.columns=id,project,priority,description
|
|
||||||
report.ls.labels=ID,Project,Pri,Description
|
|
||||||
report.ls.sort=priority-,project+
|
|
||||||
report.ls.filter=status:pending
|
|
||||||
|
|
||||||
# newest
|
|
||||||
report.newest.description=Shows the newest tasks
|
|
||||||
report.newest.columns=id,project,priority,due,active,age,description
|
|
||||||
report.newest.labels=ID,Project,Pri,Due,Active,Age,Description
|
|
||||||
report.newest.sort=id-
|
|
||||||
report.newest.filter=status:pending limit:10
|
|
||||||
|
|
||||||
# oldest
|
|
||||||
report.oldest.description=Shows the oldest tasks
|
|
||||||
report.oldest.columns=id,project,priority,due,active,age,description
|
|
||||||
report.oldest.labels=ID,Project,Pri,Due,Active,Age,Description
|
|
||||||
report.oldest.sort=id+
|
|
||||||
report.oldest.filter=status:pending limit:10
|
|
||||||
|
|
||||||
# overdue
|
|
||||||
report.overdue.description=Lists overdue tasks matching the specified criteria
|
|
||||||
report.overdue.columns=id,project,priority,due,active,age,description
|
|
||||||
report.overdue.labels=ID,Project,Pri,Due,Active,Age,Description
|
|
||||||
report.overdue.sort=due+,priority-,project+
|
|
||||||
report.overdue.filter=status:pending due.before:today
|
|
||||||
|
|
||||||
# active
|
|
||||||
report.active.description=Lists active tasks matching the specified criteria
|
|
||||||
report.active.columns=id,project,priority,due,active,age,description
|
|
||||||
report.active.labels=ID,Project,Pri,Due,Active,Age,Description
|
|
||||||
report.active.sort=due+,priority-,project+
|
|
||||||
report.active.filter=status:pending start.any:
|
|
||||||
|
|
||||||
# completed
|
|
||||||
report.completed.description=Lists completed tasks matching the specified criteria
|
|
||||||
report.completed.columns=end,project,priority,age,description
|
|
||||||
report.completed.labels=Complete,Project,Pri,Age,Description
|
|
||||||
report.completed.sort=end+,priority-,project+
|
|
||||||
report.completed.filter=status:completed
|
|
||||||
|
|
||||||
# recurring
|
|
||||||
report.recurring.description=Lists recurring tasks matching the specified criteria
|
|
||||||
report.recurring.columns=id,project,priority,due,recur,active,age,description
|
|
||||||
report.recurring.labels=ID,Project,Pri,Due,Recur,Active,Age,Description
|
|
||||||
report.recurring.sort=due+,priority-,project+
|
|
||||||
report.recurring.filter=status:pending parent.any:
|
|
||||||
|
|
||||||
# pcal
|
|
||||||
report.pcal.description=Format suitable for pcal
|
|
||||||
report.pcal.labels=Due,ID,Description
|
|
||||||
report.pcal.columns=due,id,description_only
|
|
||||||
report.pcal.sort=due+
|
|
||||||
report.pcal.filter=due.any: status:pending
|
|
||||||
|
|
||||||
### review
|
|
||||||
review.pri.none
|
|
||||||
review.due.none
|
|
||||||
review.overdue
|
|
||||||
review.oldest
|
|
||||||
|
|
||||||
### shadow file
|
|
||||||
shadow.file=
|
|
||||||
shadow.command=
|
|
||||||
shadow.notify=
|
|
||||||
|
|
||||||
### statistics
|
|
||||||
# stats.exclude=proj.foo
|
|
||||||
|
|
||||||
### verbosity
|
|
||||||
verbosity=chatty #mute, quiet, chatty, exhaustive
|
|
||||||
verbosity.tips=~/.task/fortune.txt
|
|
||||||
|
|
4
with_lua
4
with_lua
|
@ -12,10 +12,6 @@ esac
|
||||||
# Command:
|
# Command:
|
||||||
#./configure
|
#./configure
|
||||||
|
|
||||||
# Cygwin 1.7:
|
|
||||||
# Command:
|
|
||||||
#./configure --with-ncurses --with-ncurses-inc=/usr/include/ncurses
|
|
||||||
|
|
||||||
# Ubuntu 9.10:
|
# Ubuntu 9.10:
|
||||||
# sudo apt-get install lualib5.1-0-dev
|
# sudo apt-get install lualib5.1-0-dev
|
||||||
# The library name is also liblua5.1.a, with no symlink to liblua.a.
|
# The library name is also liblua5.1.a, with no symlink to liblua.a.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue