lilalo

diff l3-agent @ 114:658b4ea105c1

PS1 bug fixed
author igor
date Sun Mar 09 02:38:56 2008 +0200 (2008-03-09)
parents 0d49f33696b3
children 9e6359b7ad55
line diff
     1.1 --- a/l3-agent	Sun Nov 12 17:34:47 2006 +0200
     1.2 +++ b/l3-agent	Sun Mar 09 02:38:56 2008 +0200
     1.3 @@ -216,7 +216,7 @@
     1.4              ([0-9]+)[\#]                # uid
     1.5              ([0-9]+)[\#]                # pid
     1.6              ([0-9]+)[\#]                # time
     1.7 -            (.*?)[\#]                     # pwd
     1.8 +            (.*?)[\#]                   # pwd
     1.9              .\\[1024D.\\[K              # killing symbols
    1.10              (.*?([\$\#]\\s?))           # prompt
    1.11              (.*)                        # command line
    1.12 @@ -226,6 +226,31 @@
    1.13      my $cline_re_v2 = qr/$cline_re_v2_base/sx;
    1.14      my $cline_re2_v2 = qr/$cline_re_v2_base$/sx;
    1.15  
    1.16 +    my $cline_re_v3_base = qq'
    1.17 +            (
    1.18 +            v3[\#]                      # version
    1.19 +            .*
    1.20 +            )
    1.21 +            ';
    1.22 +    my $cline_re_v3 = qr/$cline_re_v3_base/sx;
    1.23 +
    1.24 +    my $cline_re2_v3_base = qq'
    1.25 +            (
    1.26 +            v3[\#]                      # version
    1.27 +            ([0-9]+)[\#]                # history line number
    1.28 +            ([0-9]+)[\#]                # exitcode
    1.29 +            ([0-9]+)[\#]                # uid
    1.30 +            ([0-9]+)[\#]                # pid
    1.31 +            ([0-9]+)[\#]                # time
    1.32 +            (.*?)[\#]                   # pwd
    1.33 +            (.*?([\$\#]\\s?))           # prompt
    1.34 +            (.*)                        # command line
    1.35 +            )
    1.36 +            ';
    1.37 +    my $cline_re2_v3 = qr/$cline_re2_v3_base$/sx;
    1.38 +
    1.39 +
    1.40 +
    1.41      my $vt = Term::VT102->new ( 'cols' => $Config{"terminal_width"}, 
    1.42                                  'rows' => $Config{"terminal_height"});
    1.43      my $cline_vt = Term::VT102->new (
    1.44 @@ -420,15 +445,19 @@
    1.45                  next;
    1.46              }
    1.47  
    1.48 -
    1.49 -            elsif (m/$cline_re_v2/) {
    1.50 -
    1.51 -
    1.52 +            elsif (m/$cline_re_v2/ || m/$cline_re_v3/) {
    1.53  # Разбираем командную строку версии 2
    1.54  
    1.55 -
    1.56                  s/.*\x0d(?!\x0a)//;
    1.57 -                m/$cline_re2_v2/gs;
    1.58 +                my $re;
    1.59 +                if (m/$cline_re_v2/) {
    1.60 +                    $re=$cline_re2_v2;
    1.61 +                }
    1.62 +                else {
    1.63 +                    s/.\[1K.\[10D//gs;
    1.64 +                    $re=$cline_re2_v3;
    1.65 +                }
    1.66 +                m/$re/gs;
    1.67  
    1.68                  $commandlines_loaded++;
    1.69                  $last_output_length=0;