PATCH: use Term::ReadLine only when needed

Hi,

The following patch for the rt-command avoids initializing the terminal
with Term::ReadLine unless it is needed (rt shell).

Without this patch, you can notice the cursor moving around whenever you
execute an rt command (like rt list or rt edit) and if you resize the
window, you get very unpleasing errors.

Cheers
David

— bin/rt.in~ 2006-03-21 03:18:44.000000000 +0100
+++ bin/rt.in 2006-04-26 14:48:02.742296000 +0200
@@ -82,9 +82,7 @@
my $session = new Session(“$HOME/.rt_sessions”);
my $REST = “$config{server}/REST/1.0”;

-my $term = new Term::ReadLine ‘RT CLI’;
my $prompt = 'rt> ';
-my $TERM_OUT = $term->OUT || *STDOUT;

sub whine;
sub DEBUG { warn @_ if $config{debug} >= shift }
@@ -149,6 +147,7 @@

sub shell {
$|=1;

  • my $term = new Term::ReadLine ‘RT CLI’;
    while ( defined ($_ = $term->readline($prompt)) ) {
    next if /^#/ || /^\s*$/;

David Schweikert | phone: +41 44 632 7019
System manager ISG.EE | walk: ETH Zentrum, ETL F24.1
ETH Zurich, Switzerland | web: http://people.ee.ethz.ch/dws

Hi,

The following patch for the rt-command avoids initializing the terminal
with Term::ReadLine unless it is needed (rt shell).

Without this patch, you can notice the cursor moving around whenever you
execute an rt command (like rt list or rt edit) and if you resize the
window, you get very unpleasing errors.

This patch makes the test suite start failing tests. I suspect it’s just
a test suite inconsistency. I’ve forwarded it on to Kevin to look at.
(probably on monday)

Hi,

The following patch for the rt-command avoids initializing the terminal
with Term::ReadLine unless it is needed (rt shell).

Without this patch, you can notice the cursor moving around whenever you
execute an rt command (like rt list or rt edit) and if you resize the
window, you get very unpleasing errors.

This patch makes the test suite start failing tests. I suspect it’s just
a test suite inconsistency. I’ve forwarded it on to Kevin to look at.
(probably on monday)

I wasn’t seeing the test failures Jesse was getting. Applied as r5143.