Remove 'terminal_chdir' code

Code previously added did not work as intended, so removed as it was unnecessary.

Leave in macro substitution for '--action' though as this resolves Github issue #42.

Rework wording in Changes file
This commit is contained in:
Duncan Ferguson 2015-11-15 21:12:10 +00:00
parent 3f79f1ff54
commit 43d4f1d246
5 changed files with 9 additions and 36 deletions

View file

@ -1,6 +1,6 @@
4.04_01 0000-00-00 Duncan Ferguson <duncan_ferguson@user.sf.net> 4.04_01 0000-00-00 Duncan Ferguson <duncan_ferguson@user.sf.net>
- Ensure documentation is generated using same perl as the build (Github issue #45) - Ensure documentation is generated using same perl as the build (Github issue #45)
- New config file settings to allow terminals to run from different directories (Github issue #42) - Pass '--action' through macro parsing (Github issue #42)
- Workaround for glitch in KDE where windows can become unmoveable (Github issue #46) (thanks to Brandon Perkins) - Workaround for glitch in KDE where windows can become unmoveable (Github issue #46) (thanks to Brandon Perkins)
4.04 2015-11-03 Duncan Ferguson <duncan_ferguson@user.sf.net> 4.04 2015-11-03 Duncan Ferguson <duncan_ferguson@user.sf.net>

View file

@ -529,11 +529,12 @@ sub substitute_macros {
{ {
my $macro_username = $self->config->{macro_username}; my $macro_username = $self->config->{macro_username};
my $username = $servers{$svr}{username}; my $username = $servers{$svr}{username};
$username ||= getpwuid($UID);
$text =~ s!$macro_username!$username!xsmg; $text =~ s!$macro_username!$username!xsmg;
} }
{ {
my $macro_newline = $self->config->{macro_newline}; my $macro_newline = $self->config->{macro_newline};
$text =~ s!$macro_newline!$/!xsmg; $text =~ s!$macro_newline!\n!xsmg;
} }
{ {
my $macro_version = $self->config->{macro_version}; my $macro_version = $self->config->{macro_version};
@ -730,26 +731,10 @@ sub open_client_windows(@) {
# affecting the main program # affecting the main program
$servers{$server}{realname} .= "==" if ( !$realname ); $servers{$server}{realname} .= "==" if ( !$realname );
# If set, use the chdir path # copy and amend the config provided to the helper script
if ( $self->config->{terminal_chdir} ) { my $local_config = $self->config;
my $chdir_path = $self->substitute_macros( $server, $local_config->{command} = $self->substitute_macros( $server,
$self->config->{terminal_chdir_path} ); $local_config->{command} );
if ( !-d $chdir_path ) {
$self->debug( 1,
"Creating terminal directory path '$chdir_path'" );
make_path($chdir_path)
|| $self->debug( 0,
"WARNING: Could not create '$chdir_path'" );
}
$self->debug( 1,
"Changing directory to $chdir_path for terminal to $given_server_name"
);
chdir($chdir_path)
|| $self->debug( 0,
"WARNING: Could not change directory to '$chdir_path': $!"
);
}
my $exec = join( ' ', my $exec = join( ' ',
$self->config->{terminal}, $self->config->{terminal},

View file

@ -63,9 +63,6 @@ my %default_config = (
terminal_decoration_height => 10, terminal_decoration_height => 10,
terminal_decoration_width => 8, terminal_decoration_width => 8,
terminal_chdir_path => $ENV{HOME} . '/.clusterssh/work/%s',
terminal_chdir => 0,
console => 'console', console => 'console',
console_args => '', console_args => '',
rsh => 'rsh', rsh => 'rsh',

View file

@ -63,7 +63,6 @@ sub script {
my \$port=shift; my \$port=shift;
my \$mstr=shift; my \$mstr=shift;
my \$command="$comms $comms_args "; my \$command="$comms $comms_args ";
my \$cwd=qx!pwd!;
open(PIPE, ">", \$pipe) or die("Failed to open pipe: \$!\\n"); open(PIPE, ">", \$pipe) or die("Failed to open pipe: \$!\\n");
print PIPE "\$\$:\$ENV{WINDOWID}" print PIPE "\$\$:\$ENV{WINDOWID}"
or die("Failed to write to pipe: $!\\n"); or die("Failed to write to pipe: $!\\n");
@ -101,9 +100,7 @@ sub script {
} }
\$command .= " ; $postcommand"; \$command .= " ; $postcommand";
# provide some info for debugging purposes # provide some info for debugging purposes
warn("Running: \\n"); warn("Running: \$command\\n");
warn(" pwd: \$cwd"); # already has newline
warn(" cmd: \$command\\n");
exec(\$command); exec(\$command);
HERE HERE

View file

@ -28,8 +28,6 @@ isa_ok( $config, 'App::ClusterSSH::Config' );
Readonly::Hash my %default_config => { Readonly::Hash my %default_config => {
terminal => "xterm", terminal => "xterm",
terminal_chdir => 0,
terminal_chdir_path => $ENV{HOME} . '/.clusterssh/work/%s',
terminal_args => "", terminal_args => "",
terminal_title_opt => "-T", terminal_title_opt => "-T",
terminal_colorize => 1, terminal_colorize => 1,
@ -519,9 +517,7 @@ is( $trap->stderr,
note('Checking dump'); note('Checking dump');
$config = App::ClusterSSH::Config->new( $config = App::ClusterSSH::Config->new(
send_menu_xml_file => $ENV{HOME} . '/.clusterssh/send_menu', send_menu_xml_file => $ENV{HOME} . '/.clusterssh/send_menu', );
terminal_chdir_path => $ENV{HOME} . '/.clusterssh/work/%s',
);
trap { trap {
$config->dump(); $config->dump();
@ -574,8 +570,6 @@ terminal=xterm
terminal_allow_send_events=-xrm '*.VT100.allowSendEvents:true' terminal_allow_send_events=-xrm '*.VT100.allowSendEvents:true'
terminal_args= terminal_args=
terminal_bg_style=dark terminal_bg_style=dark
terminal_chdir=0
terminal_chdir_path=} . $ENV{HOME} . qq{/.clusterssh/work/%s
terminal_colorize=1 terminal_colorize=1
terminal_decoration_height=10 terminal_decoration_height=10
terminal_decoration_width=8 terminal_decoration_width=8