Commit 01ec6b48 authored by Alejandro Garrido Mota's avatar Alejandro Garrido Mota

Merge tag 'upstream/1.2'

Upstream version 1.2

# gpg: Firmado el dom 20 abr 2014 13:04:20 VET usando clave RSA ID F1C09EFB
# gpg: Firma correcta de "Alejandro Garrido Mota (mogaal) <garridomota@gmail.com>"
# gpg:                 alias "Alejandro Garrido Mota (mogaal) <mogaal@cpan.org>"
# gpg:                 alias "Alejandro Garrido Mota <alejandro@debian.org>"
parents 00ed6440 eaa468b6
The development of Vit was made possible by the significant
contributions of the following people:
Scott Kostyshak (Maintainer and Contributing Author)
Steve Rader (Original Author)
Paul Beckingham (Advisor)
David J Patrick (Designer)
The following submitted code, packages or analysis, and deserve special thanks:
Bryce Harrington
Nemo Inis
Devendra Ghate
Thanks to the following, who submitted detailed bug reports and excellent
suggestions:
Ben Boeckel
Michael Ahern
Peter Lewis
Jean-Philippe Rutault
Jason Woofenden
Sun Apr 6 2013 - released v1.2
Tue Apr 1 2014 - the <Esc> key can now be used in shortcuts
Tue Apr 1 2014 - exit with informative error if shortcut too long (see VT-81)
Thu Mar 13 2014 - fix colors for running VIT in tmux
Sat Mar 8 2014 - do not print control characters to prompts
Thu Mar 6 2014 - fix recognition of backspace in tmux
Thu Mar 6 2014 - fix a prompt bug that prevented editing
Mon Mar 3 2014 - 'vit -audit' now creates a log with debug info
Tue Feb 4 2014 - released v1.2.beta1
Tue Feb 4 2014 - Add VIT man pages (#1284)
Mon Oct 21 2013 - Implement cursor movement in prompts (#1403)
Sun Oct 6 2013 - Clear project prompt string if escape (#1232)
Sun Oct 6 2013 - Remove confusing behavior from arrow keys in prompts (#1363)
Sun Sep 28 2013 - 'P' now sets priority and 'h', 'm', 'l', 'n' are freed (#1238)
Sun Sep 27 2013 - 'c' is renamed to 'm' (#1231)
Sun Sep 15 2013 - 't' now opens the command prompt with ":!rw task "
Sun Sep 15 2013 - shell commands can now pass the arguments VIT is using (#1338, #1237)
Sat Sep 14 2013 - custom keybinds can now be specified in ~/.vitrc (#1237, #1302, #1336)
Thu Sep 12 2013 - added ':!' to execute arbitrary string in shell
Sun Aug 12 2013 - When running an external command, VIT no longer echoes it
Sun Aug 11 2013 - VIT now cleans the terminal before exiting
Sun Aug 11 2013 - 'q' ('Q') now quits with(out) confirmation (#1266)
Thu Aug 9 2013 - fix a bug where prompt text was invisible
Mon Aug 5 2013 - 's' now runs 'task sync' if Taskwarrior >= 2.3.0 (#1301)
Sun Aug 4 2013 - when in search mode, backspace now removes a character
Sat Aug 3 2013 - 'D' now deletes a task when not over an annotation (#1230)
Sat Jul 6 2013 - added Copyright 2013, Scott Kostyshak
Sat Jul 6 2013 - added an AUTHORS file listing contributors
Sat Jul 6 2013 - 'gg' now moves to first line (#1229)
Sun Jun 23 2013 - added Copyright 2012 - 2013, Steve Rader
Wed Apr 3 2013 - released v1.1
Wed Apr 3 2013 - fixes for not having color=on set in ~/.taskrc
......
......@@ -2,7 +2,7 @@
Install Instructions for VIT
----------------------------
## confugre the Makefile...
## configure the Makefile...
./configure
## build the script...
......
......@@ -4,7 +4,7 @@ the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
Foobar is distributed in the hope that it will be useful, but WITHOUT
Vit is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
......@@ -12,3 +12,5 @@ for more details.
You should have received a copy of the GNU General Public License along
with Vit. If not, see <http://www.gnu.org/licenses/>.
Copyright 2012 - 2013, Steve Rader
Copyright 2013 - 2014, Scott Kostyshak
......@@ -24,4 +24,7 @@ prompt.pl
read.pl
screen.pl
search.pl
vit.1
vit.pl
vitrc.5
vitrc.pl
PARTS = args.pl cmdline.pl cmds.pl color.pl curses.pl draw.pl env.pl exec.pl \
getch.pl misc.pl prompt.pl read.pl search.pl screen.pl
getch.pl misc.pl prompt.pl read.pl search.pl screen.pl vitrc.pl
PREFIX=@prefix@
VERSION=@VERSION@
......@@ -30,6 +30,10 @@ build:
install:
sudo mkdir -p @prefix@/bin
sudo cp vit @prefix@/bin/vit
sudo mkdir -p @prefix@/man/man1
sudo cp vit.1 @prefix@/man/man1/
sudo mkdir -p @prefix@/man/man5
sudo cp vitrc.5 @prefix@/man/man5/
sudo mkdir -p @prefix@/etc/
sudo cp commands @prefix@/etc/vit-commands
......
......@@ -21,15 +21,18 @@
xterm -geom 100x40 +sb -e /usr/local/bin/vit -titlebar &
Downloads:
http://www.hep.wisc.edu/~rader/vit/
http://taskwarrior.org/projects/taskwarrior/wiki/Vit
If you actually use this program, feel free to send me a msg and let me know.
steve
--
<rader@physics.wisc.edu>
director of computing
physics department
university of wisconsin
http://www.physics.wisc.edu/computing/
Our friend and collaborator Steve Rader passed away in May 2013. We owe a lot
to Steve for his excellent work, and so vit is preserved, maintained and
continued.
Taskwarrior Team
support@taskwarrior.org
# Copyright 2012 - 2013, Steve Rader
# Copyright 2013 - 2014, Scott Kostyshak
sub parse_args {
while ( @ARGV ) {
if ( $ARGV[0] eq '-help' ) {
if ( $ARGV[0] eq '-help' ) {
&usage();
}
if ( $ARGV[0] eq '-audit' || $ARGV[0] eq '-a' ) {
if ( $ARGV[0] eq '-audit' || $ARGV[0] eq '-a' ) {
$audit = 1;
shift @ARGV;
next;
......@@ -19,7 +21,15 @@ sub parse_args {
next;
}
if ( $audit ) {
print STDERR "$$ INIT $0 " . join(' ',@ARGV), "\r\n";
open(AUDIT, ">", "vit_audit.log") or die "$!";
open STDERR, '>&AUDIT';
# flush AUDIT after printing to it
my $ofh = select AUDIT;
$| = 1;
select $ofh;
print AUDIT "$$ INIT $0 " . join(' ',@ARGV), "\r\n";
}
}
......@@ -27,7 +37,7 @@ sub parse_args {
sub usage {
print "usage: vit [switches] [task_args]\n";
print " -audit print task commands to stderr\n";
print " -audit print task commands to vit_audit.log\n";
print " -titlebar sets the xterm titlebar to \"$version\"\n";
print " task_args any set of task commandline args that print an \"ID\" column\n";
exit 1;
......
# Copyright 2012 - 2013, Steve Rader
# Copyright 2013 - 2014, Scott Kostyshak
sub cmd_line {
&audit("Inside of cmd_line");
my ($prompt) = @_;
my $str = &prompt_str($prompt);
if ( $str eq '' ) {
if ( $str eq '' ) {
&draw_prompt_line('');
return;
}
if ( $str =~ /^!(.*)/ ) {
my $rtn = &shell_command($1);
return;
}
if ( $str =~ /^\d+$/ ) {
if ( ! defined $taskid2report[$str] ) {
if ( ! defined $taskid2report[$str] ) {
$error_msg = "Error: task number $str not found";
&draw_error_msg();
return;
}
$task_selected_idx = $taskid2report[$str] - 1;
if ( $display_start_idx + $REPORT_LINES < $task_selected_idx ) {
if ( $display_start_idx + $REPORT_LINES < $task_selected_idx ) {
$display_start_idx = int($task_selected_idx - $REPORT_LINES + ($REPORT_LINES / 2));
}
if ( $display_start_idx > $task_selected_idx ) {
if ( $display_start_idx > $task_selected_idx ) {
$display_start_idx = int($task_selected_idx - $REPORT_LINES + ($REPORT_LINES / 2));
if ( $display_start_idx < 0 ) {
$display_start_idx = 0;
} elsif ( $display_start_idx > $task_selected_idx) {
if ( $display_start_idx < 0 ) {
$display_start_idx = 0;
} elsif ( $display_start_idx > $task_selected_idx) {
$display_start_idx = $task_selected_idx;
}
}
......@@ -29,7 +36,7 @@ sub cmd_line {
}
if ( $str =~ /^s\/(.*?)\/(.*)\/$/ || $str =~ /^%s\/(.*?)\/(.*)\/$/ ) {
my ($old,$new) = ($1,$2);
my $rtn = &task_modify("/$old/$new/");
my $rtn = &task_modify("/$old/$new/");
$reread_needed = 1;
return;
}
......@@ -37,14 +44,14 @@ sub cmd_line {
&shell_exec("view $commands_file",'no-wait');
return;
}
if ( $str =~ /^help (.*)/ || $str =~ /^h (.*)/ ) {
if ( $str =~ /^help (.*)/ || $str =~ /^h (.*)/ ) {
my $p = $1;
my $tmp_file = "/tmp/vit-help.$$";
open(IN,"<$commands_file");
open(OUT,">$tmp_file");
print OUT "\n";
while(<IN>) {
if ( $_ =~ /$p/ ) {
if ( $_ =~ /$p/ ) {
print OUT $_;
}
}
......@@ -55,15 +62,14 @@ sub cmd_line {
unlink($tmp_file);
return;
}
if ( $str eq 'q' ) {
endwin();
exit();
if ( $str eq 'q' ) {
&clean_exit();
}
if ( grep(/^$str$/,@report_types) ) {
$prev_command = $current_command;
$current_command = $str;
&read_report('init');
&draw_screen();
&draw_screen();
return;
}
if ( $str =~ /^(.*?) .*/ ) {
......@@ -72,7 +78,7 @@ sub cmd_line {
$prev_command = $current_command;
$current_command = $str;
&read_report('init');
&draw_screen();
&draw_screen();
return;
}
}
......
# Copyright 2012 - 2013, Steve Rader
# Copyright 2013 - 2014, Scott Kostyshak
#------------------------------------------------------------------
sub prompt_quit {
my $yes;
$yes = &prompt_y("Quit?");
if ( ! $yes ) {
&draw_prompt_line('');
return;
}
endwin();
exit();
}
#------------------------------------------------------------------
sub task_add {
my $str = &prompt_str("Add: ");
if ( $str eq '' ) {
if ( $str eq '' ) {
&draw_prompt_line('');
return;
return;
}
my ($es,$result) = &task_exec("add \"$str\"");
if ( $es != 0 ) {
......@@ -22,9 +37,9 @@ sub task_add {
sub task_annotate {
my $id = $report2taskid[$task_selected_idx];
my $str = &prompt_str("Annotate: ");
if ( $str eq '' ) {
if ( $str eq '' ) {
&draw_prompt_line('');
return;
return;
}
my ($es,$result) = &task_exec("$id annotate \"$str\"");
if ( $es != 0 ) {
......@@ -39,30 +54,30 @@ sub task_annotate {
#------------------------------------------------------------------
sub task_denotate {
sub task_den_or_del {
my ($ch, $str, $yes);
my $id = $report2taskid[$task_selected_idx];
for my $t (0 .. $#{ $report_tokens[$task_selected_idx] } ) {
$str .= "$report_tokens[$task_selected_idx][$t]";
}
if ( $str !~ s/^\s*\d+\/\d+\/\d+\s+// ) {
&draw_prompt_line('');
beep();
return;
}
my $target = ( $str !~ s/^\s*\d+\/\d+\/\d+\s+// )
? "task"
: "annotation";
$str =~ s/\s+$//;
$yes = &prompt_y("Delete current annotation? ");
$yes = &prompt_y("Delete current $target? ");
if ( ! $yes ) {
&draw_prompt_line('');
return;
}
my ($es,$result) = &task_exec("$id denotate \"$str\"");
if ( $es != 0 ) {
my ($es,$result) = ($target eq "annotation")
? &task_exec("$id denotate \"$str\"")
: &task_exec("$id delete rc.confirmation:no");
if ( $es != 0 ) {
$error_msg = $result;
&draw_error_msg();
return;
}
$feedback_msg = "Deleted annotation.";
$feedback_msg = "Deleted $target.";
&draw_feedback_msg();
&flash_current_task();
$reread_needed = 1;
......@@ -70,19 +85,6 @@ sub task_denotate {
#------------------------------------------------------------------
sub task_change {
my $id = $report2taskid[$task_selected_idx];
my $str = &prompt_str("Change: ");
if ( $str eq '' ) {
&draw_prompt_line('');
return;
}
&task_modify("$str");
$reread_needed = 1;
}
#------------------------------------------------------------------
sub task_done {
my ($ch, $str, $yes);
my $id = $report2taskid[$task_selected_idx];
......@@ -107,9 +109,9 @@ sub task_done {
sub task_filter {
my ($c, $f);
if ( $current_command =~ /(.*?)\s+(.*)/ ) {
($c,$f) = ($1,$2);
} else {
if ( $current_command =~ /(.*?)\s+(.*)/ ) {
($c,$f) = ($1,$2);
} else {
$c = $current_command;
$f = '';
}
......@@ -130,51 +132,51 @@ sub task_filter {
sub task_modify {
my $args = $_[0];
my $id = $report2taskid[$task_selected_idx];
my ($es,$result) = &task_exec("$id modify \"$args\"");
if ( $result =~ /Modified 0 tasks./ ) {
$error_msg = "Modifying task $id failed.";
&draw_error_msg();
return;
}
if ( $es != 0 ) {
$error_msg = $result;
&draw_error_msg();
&shell_exec("$task $id modify \"$args\"",'wait');
$reread_needed = 1;
}
#------------------------------------------------------------------
sub task_modify_prompt {
my $id = $report2taskid[$task_selected_idx];
my $str = &prompt_str("Modify: ");
if ( $str eq '' ) {
&draw_prompt_line('');
return;
}
$feedback_msg = "Modified task $id.";
&flash_current_task();
&task_modify("$str");
$reread_needed = 1;
}
#------------------------------------------------------------------
sub task_set_prio {
my $p = $_[0];
my $yes;
sub task_set_priority {
my $id = $report2taskid[$task_selected_idx];
my $prio = &task_info('Priority');
if ( $p eq $prio ) {
beep();
return;
}
if ( $p eq '' ) {
$yes = &prompt_y("Set task ${id}'s priority to none? ");
} else {
$yes = &prompt_y("Set task ${id}'s priority to $p? ");
}
if ( ! $yes ) {
if ( $prio eq '' ) {
$prio = 'N';
}
my $p = &prompt_chr("Change priority (l/m/h/n): ");
$p = uc($p);
if ( $p ne $prio && $p =~ /[LMHN]/ ) {
if ( $p eq 'N' ) {
$p = '';
}
my ($es,$result) = &task_exec("$id modify prio:$p");
if ( $es != 0 ) {
$error_msg = $result;
&draw_error_msg();
return;
}
$feedback_msg = "Modified task $id.";
&flash_current_task();
$reread_needed = 1;
}
else {
&draw_prompt_line('');
return;
}
my ($es,$result) = &task_exec("$id modify prio:$p");
if ( $es != 0 ) {
$error_msg = $result;
&draw_error_msg();
return;
}
$feedback_msg = "Modified task $id.";
&flash_current_task();
$reread_needed = 1;
}
#------------------------------------------------------------------
......@@ -182,13 +184,17 @@ sub task_set_prio {
sub task_set_project {
my $id = $report2taskid[$task_selected_idx];
my $p = &prompt_str("Project: ");
if ( $p eq '' ) {
&draw_prompt_line('');
return;
}
my $proj = &task_info('Project');
if ( $p eq $proj ) {
if ( $p eq $proj ) {
beep();
return;
}
my ($es,$result) = &task_exec("$id modify proj:$p");
if ( $es != 0 ) {
if ( $es != 0 ) {
$error_msg = $result;
&draw_error_msg();
return;
......@@ -198,4 +204,38 @@ sub task_set_project {
$reread_needed = 1;
}
#------------------------------------------------------------------
sub shell_command {
my $args = $_[0];
my ($opts, $cmd);
if ( $args =~ /([^ ]*) (.+)/ ) {
$opts = $1;
$cmd = $2;
}
else {
$error_msg = "Empty shell command for ':!'. See help (:h).";
&draw_error_msg();
return;
}
my $wait = "no-wait";
foreach my $l ( split //, $opts ) {
if ( $l eq 'r' ) {
$reread_needed = 1;
} elsif ( $l eq 'w' ) {
$wait = "wait";
} else {
$error_msg = "$l is not a valid command option to ':!'. See help (:h).";
&draw_error_msg();
return;
}
}
$cmd =~ s/%TASKID/$report2taskid[$task_selected_idx]/g;
$cmd =~ s/%TASKARGS/$current_command/g;
&shell_exec($cmd,"$wait");
}
return 1;
# Copyright 2012 - 2013, Steve Rader
# Copyright 2013 - 2014, Scott Kostyshak
sub parse_report_line {
my ($l,$str) = @_;
&parse_line($l,$str);
if ( $current_command eq 'summary' && $parsed_tokens[0] =~ /^(\d+) project/ ) {
if ( $current_command eq 'summary' && $parsed_tokens[0] =~ /^(\d+) project/ ) {
$num_projects = $1;
return;
return;
}
push @{ $report_tokens[$l] }, (@parsed_tokens);
push @{ $report_colors_fg[$l] }, (@parsed_colors_fg);
......@@ -31,8 +33,8 @@ sub parse_line {
$attr = '';
CASE: {
# ANSI 16 color attr pairs...
if ( $tok =~ s/\[(\d+);(\d+)m// ) {
my ($a,$b) = ($1,$2);
if ( $tok =~ s/\[(\d+);(\d+)m// ) {
my ($a,$b) = ($1,$2);
if ( $a > 30 ) {
$fg = $a - 30;
$bg = $b - 40;
......@@ -50,7 +52,7 @@ sub parse_line {
}
# ANSI 16 color single colors or single attrs or attrs off...
if ( $tok =~ s/\[(\d+)m// ) {
my $a = $1;
my $a = $1;
if ( $a eq '0' ) {
$fg = $bg = 999999;
$attr .= 'none ';
......@@ -72,43 +74,43 @@ sub parse_line {
last CASE;
}
# ANSI 16 color bold...
if ( $tok =~ s/\[1;(\d+);(\d+)m// ) {
my ($a,$b) = ($1,$2);
$attr .= 'bold ';
$fg = $a - 30;
$bg = $b - 40;
if ( $tok =~ s/\[1;(\d+);(\d+)m// ) {
my ($a,$b) = ($1,$2);
$attr .= 'bold ';
$fg = $a - 30;
$bg = $b - 40;
last CASE;
}
# ANSI 16 color underline...
if ( $tok =~ s/\[4;(\d+);(\d+)m// ) {
my ($a,$b) = ($1,$2);
$attr .= 'underline ';
$fg = $a - 30;
$bg = $b - 40;
if ( $tok =~ s/\[4;(\d+);(\d+)m// ) {
my ($a,$b) = ($1,$2);
$attr .= 'underline ';
$fg = $a - 30;
$bg = $b - 40;
last CASE;
}
# ANSI 16 color inverse...
if ( $tok =~ s/\[7;(\d+);(\d+)m// ) {
my ($a,$b) = ($1,$2);
$attr .= 'inverse ';
$fg = $a - 30;
$bg = $b - 40;
if ( $tok =~ s/\[7;(\d+);(\d+)m// ) {
my ($a,$b) = ($1,$2);
$attr .= 'inverse ';
$fg = $a - 30;
$bg = $b - 40;
last CASE;
}
# 256 color xterm foreground...
if ( $tok =~ s/\[38;5;(\d+)m// ) {
$fg = $1;
if ( $tok =~ s/\[38;5;(\d+)m// ) {
$fg = $1;
last CASE;
}
# 256 color xterm background...
if ( $tok =~ s/\[48;5;(\d+)m// ) {
$bg = $1;
if ( $tok =~ s/\[48;5;(\d+)m// ) {
$bg = $1;
last CASE;
}
}
}
# FIXME summary mode...
# if ( $tok =~ /0%\s+100%/ ) { debug("summary graph tok=\"$tok\" column=$t"); }
if ( $tok ne '' ) {
if ( $tok ne '' ) {
$parsed_tokens[$t] = $tok;
$parsed_colors_fg[$t] = $fg;
$parsed_colors_bg[$t] = $bg;
......@@ -129,8 +131,8 @@ sub extract_color {
$parsed_attrs[1] = '';
&audit("EXEC $task rc._forcecolor=on color $s 2>&1");
open(IN2,"$task rc._forcecolor=on color $s 2>&1 |");
while(<IN2>){
if ( $_ =~ /Your sample:/ ) {
while(<IN2>){
if ( $_ =~ /Your sample:/ ) {
$_ = <IN2>; $_ = <IN2>;
&parse_line(0,$_);
if ( $parsed_colors_fg[1] eq '999999' ) { $parsed_colors_fg[1] = -1; }
......
cmd a STRING add a new task
cmd A STRING add an annotation to the current task
cmd c STRING change the current task's description
cmd m STRING modify the current task
cmd :![rw] STRING execute "STRING" in shell. 'r' rereads, 'w' waits
cmd t prepend the command prompt with ":!rw task "
cmd :s/OLD/NEW/ change OLD to NEW in the current task's description
cmd :%s/OLD/NEW/ change OLD to NEW in the current task's description
cmd D delete the current annotation (denotate)
cmd D denotate if over annotation, delete task if on first line
cmd e edit the current task
cmd = view the current task's info
cmd <enter> view the current task's info
......@@ -13,6 +15,8 @@
rpt :REPORT FILTER display REPORT with FILTER
rpt :STRING<tab> display REPORT using tab completion
rpt :<tab> display REPORT using tab completion of all defined reports
cmd q exit after confirmation
cmd Q exit
cmd ZZ exit
cmd :q exit
cmd f FILTER filter the current report with FILTER
......@@ -22,6 +26,7 @@
nav Spacebar move down one line
nav :N move to task number N
nav 0 move to the first line
nav gg move to the first line
nav H move to the first line on screen
nav G move to the last line
nav L move to the last line on screen
......@@ -37,10 +42,7 @@
nav PgUp scroll up (back) up one page
cmd /STRING search forwards for STRING
cmd ?STRING search backwards for STRING
cmd h set the current task's priority to H (high)
cmd l set the current task's priority to L (low)
cmd m set the current task's priority to M (medium)
cmd n set the current task's priority to none
cmd P [hmln] set the current task's priority to H, M, L, or none
cmd p STRING set the current task's project to STRING
cmd p STRING<tab> set the current task's project to STRING using tab completion
cmd p <tab> set the current task's project using tab completion
......
# Copyright 2012 - 2013, Steve Rader
# Copyright 2013 - 2014, Scott Kostyshak
sub init_curses {
my $m = $_[0];
......@@ -6,11 +8,11 @@ sub init_curses {
curs_set(0);
start_color();
use_default_colors();
init_pair($COLOR_ERRORS,231,1); # white on red # FIXME xterm specific, wrong for ANSI
if ( $m eq 'init' ) {
init_pair($COLOR_SELECTION,231,4); # white on blue # FIXME xterm specific, wrong for ANSI
init_pair($COLOR_ERRORS,COLOR_WHITE,COLOR_RED);
if ( $m eq 'init' ) {
init_pair($COLOR_SELECTION,COLOR_WHITE,COLOR_BLUE);
}
init_pair($COLOR_EMPTY_LINE,4,-1); # blue foreground
init_pair($COLOR_EMPTY_LINE,COLOR_BLUE,-1); # blue foreground
my $HEADER_SIZE = 3;
$REPORT_LINES = $LINES - $HEADER_SIZE - 1;
$REPORT_COLS = $COLS - 2;
......@@ -18,6 +20,7 @@ sub init_curses {
$report_win = newwin($REPORT_LINES+$HEADER_SIZE, $REPORT_COLS+2, 3, 1);
$prompt_win = newwin(1, $COLS, $LINES-1, 0);
keypad($report_win, 1);
keypad($prompt_win, 1);
}
#------------------------------------------------------------------
......
# Copyright 2012 - 2013, Steve Rader
# Copyright 2013 - 2014, Scott Kostyshak
sub draw_header_line {
my ($row,$lhs,$rhs) = @_;
......@@ -29,6 +31,16 @@ sub draw_prompt {
#------------------------------------------------------------------
sub draw_prompt_cur {
my ($lhs) = @_;
$prompt_win->addstr(0, 0, $lhs);
$prompt_win->clrtoeol();
$prompt_win->move(0, $cur_pos);
$prompt_win->refresh();
}
#------------------------------------------------------------------
sub draw_error_msg {
beep();
&audit("ERROR $error_msg");
......@@ -92,7 +104,7 @@ sub draw_report_line {
if ( $mode eq 'with-selection' && $i == $task_selected_idx ) {
$report_win->attroff(COLOR_PAIR($COLOR_SELECTION));
&set_attroff($report_win,$selection_attrs);
} else {
} else {
$report_win->attroff(COLOR_PAIR($cp));
}
}
......
# Copyright 2012 - 2013, Steve Rader
# Copyright 2013 - 2014, Scott Kostyshak
sub init_shell_env {
if ( $ENV{'TERM'} =~ /^xterm/ || $ENV{'TERM'} =~ /^screen/ ) {
&audit("ENV TERM=xterm-256color");
$ENV{'TERM'} = 'xterm-256color';
}
}
if ( $titlebar ) {
&audit("ENV set titlebar");
open(TTY, ">>/dev/tty");
......@@ -40,7 +42,7 @@ sub init_task_env {
init_pair($COLOR_SELECTION,$parsed_colors_fg[1],$parsed_colors_bg[1]);
next;
}