Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: eserte/xterm-conf
base: 42bc058c2d
...
head fork: eserte/xterm-conf
compare: 90c9a7d992
  • 7 commits
  • 6 files changed
  • 0 commit comments
  • 1 contributor
2  .gitignore
View
@@ -1,4 +1,6 @@
/.prove
+/MYMETA.json
+/MYMETA.yml
/Makefile
/Makefile.old
/XTerm-Conf-*.tar.gz
5 Changes
View
@@ -1,5 +1,10 @@
Revision history for XTerm-Conf
+0.07_50
+ Works without -f on rxvt and urxvt.
+ Fixed minor Pod nit.
+ Live tests also with rxvt and urxvt.
+
0.07
Addressed RT #46829 (syntax error in xterm-conf)
1  MANIFEST
View
@@ -8,3 +8,4 @@ t/10-xterm.pl
t/10-xterm.t
t/11-xterm.pl
xterm-conf
+.gitignore
13 lib/XTerm/Conf.pm
View
@@ -1,10 +1,9 @@
# -*- perl -*-
#
-# $Id: Conf.pm,v 1.17 2009/07/14 05:27:13 eserte Exp $
# Author: Slaven Rezic
#
-# Copyright (C) 2006,2008,2009 Slaven Rezic. All rights reserved.
+# Copyright (C) 2006,2008,2009,2012 Slaven Rezic. All rights reserved.
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
#
@@ -22,7 +21,7 @@ use 5.006; # qr, autovivified filehandles
use strict;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
-$VERSION = '0.07';
+$VERSION = '0.07_50';
require Exporter;
@ISA = qw(Exporter);
@@ -237,7 +236,7 @@ sub xterm_conf_string {
sub xterm_conf {
return if !$ENV{TERM};
- return if $ENV{TERM} !~ m{^xterm};
+ return if $ENV{TERM} !~ m{^(xterm|rxvt)};
my $rv = xterm_conf_string(@_);
local $| = 1;
print $rv;
@@ -337,8 +336,8 @@ XTerm::Conf - change configuration of a running xterm
=head2 xterm_conf(I<options ...>)
The xterm_conf function (exported by default) checks first if the
-current terminal looks like an xterm (by looking at the C<TERM>
-environment variable) and prints the escape sequences for the
+current terminal looks like an xterm or rxvt (by looking at the
+C<TERM> environment variable) and prints the escape sequences for the
following options:
=over
@@ -610,6 +609,6 @@ Slaven ReziE<0x107>
=head1 SEE ALSO
-L<xterm-conf>, L<xterm(1)>, L<Term::Title>.
+L<xterm-conf>, L<xterm(1)>, L<rxvt(1)>, L<Term::Title>.
=cut
64 t/10-xterm.t 100644 → 100755
View
@@ -20,32 +20,56 @@ BEGIN {
}
}
+my @xterm_likes = qw(xterm rxvt urxvt);
+
my $tests = 2;
-plan tests => $tests;
+plan tests => $tests * @xterm_likes;
my(undef,$file) = tempfile(UNLINK => 1);
-SKIP: {
- skip("No xterm and/or DISPLAY on this system available", $tests)
- if (!is_in_path("xterm") || !$ENV{DISPLAY});
-
- system("xterm", "-e", $^X, "-e", q{print STDERR "# xterm can be started\n"});
- skip("Cannot start xterm", $tests)
- if $? != 0;
-
- my $xterm_version = `xterm -v`;
- diag("\nxterm version $xterm_version");
-
- system("xterm", "-xrm", "*allowWindowOps:true", "-T", "XTerm::Conf test suite", "-geometry", "+10+10", "-e", $^X, "$FindBin::RealBin/10-xterm.pl", $file);
-
- open FH, "< $file"
- or die "Can't open $file: $!";
- chomp(my $success = join "", <FH>);
- is($success, "success", "live xterm tests");
+for my $xterm (@xterm_likes) {
+ SKIP: {
+ skip("No $xterm and/or DISPLAY on this system available", $tests)
+ if (!is_in_path("$xterm") || !$ENV{DISPLAY});
+
+ system($xterm, "-e", $^X, "-e", q{print STDERR "# $xterm can be started\n"});
+ skip("Cannot start $xterm", $tests)
+ if $? != 0;
+
+ if ($xterm eq 'rxvt' || $xterm eq 'urxvt') {
+ my $rxvt_version;
+ if ($xterm eq 'rxvt') {
+ my $help_output = `$xterm --help 2>&1`;
+ for my $l (split /\n/, $help_output) {
+ next if $l eq '';
+ last if $l =~ m{^rxvt.*options.*command};
+ $rxvt_version .= $l . "\n";
+ }
+ } elsif ($xterm eq 'urxvt') {
+ my $help_output = `$xterm --help 2>&1`;
+ for my $l (split /\n/, $help_output) {
+ next if $l eq '';
+ last if $l =~ m{^Usage.*urxvt.*options};
+ $rxvt_version .= $l . "\n";
+ }
+ }
+ diag("\n$xterm\n$rxvt_version");
+ } else {
+ my $xterm_version;
+ $xterm_version = `$xterm -v`;
+ diag("\n$xterm version $xterm_version");
+ }
- system("xterm", "-xrm", "*allowWindowOps:false", "-T", "XTerm::Conf test suite", "-geometry", "+10+10", "-e", $^X, "$FindBin::RealBin/11-xterm.pl", $file);
- pass("No hangs if xterm is running with allowWindowOps:false");
+ system($xterm, "-xrm", "*allowWindowOps:true", "-T", "XTerm::Conf test suite", "-geometry", "+10+10", "-e", $^X, "$FindBin::RealBin/10-xterm.pl", $file);
+
+ open FH, "< $file"
+ or die "Can't open $file: $!";
+ chomp(my $success = join "", <FH>);
+ is($success, "success", "live $xterm tests");
+ system($xterm, "-xrm", "*allowWindowOps:false", "-T", "XTerm::Conf test suite", "-geometry", "+10+10", "-e", $^X, "$FindBin::RealBin/11-xterm.pl", $file);
+ pass("No hangs if $xterm is running with allowWindowOps:false");
+ }
}
# REPO BEGIN
2  xterm-conf 100644 → 100755
View
@@ -25,7 +25,7 @@ xterm-conf - change configuration of a running xterm
=head1 SYNOPSIS
- xterm-conf [-f|force] [options]
+ xterm-conf [-f|-force] [options]
=head1 DESCRIPTION

No commit comments for this range

Something went wrong with that request. Please try again.