- if ($inbuf =~ s/\x07+$//) {
- beep();
- }
- if (length $inbuf > $cols) {
- $Text::Wrap::Columns = $cols;
- push @shistory, wrap('',"\t", $inbuf);
+ my $l = length $inbuf;
+ if ($l > $cols) {
+ $inbuf =~ s/\s+/ /g;
+ if (length $inbuf > $cols) {
+ $Text::Wrap::columns = $cols;
+ my $token;
+ ($token) = $inbuf =~ m!^(.* de [-\w\d/\#]+:?\s+|\w{9}\@\d\d:\d\d:\d\d )!;
+ $token ||= ' ' x 19;
+ push @sh, split /\n/, wrap('', ' ' x length($token), $inbuf);
+ } else {
+ push @sh, $inbuf;
+ }