mirror of
https://github.com/duncs/clusterssh.git
synced 2025-07-02 17:33:23 +00:00
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:
parent
3f79f1ff54
commit
43d4f1d246
5 changed files with 9 additions and 36 deletions
2
Changes
2
Changes
|
@ -1,6 +1,6 @@
|
|||
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)
|
||||
- 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)
|
||||
|
||||
4.04 2015-11-03 Duncan Ferguson <duncan_ferguson@user.sf.net>
|
||||
|
|
|
@ -529,11 +529,12 @@ sub substitute_macros {
|
|||
{
|
||||
my $macro_username = $self->config->{macro_username};
|
||||
my $username = $servers{$svr}{username};
|
||||
$username ||= getpwuid($UID);
|
||||
$text =~ s!$macro_username!$username!xsmg;
|
||||
}
|
||||
{
|
||||
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};
|
||||
|
@ -730,26 +731,10 @@ sub open_client_windows(@) {
|
|||
# affecting the main program
|
||||
$servers{$server}{realname} .= "==" if ( !$realname );
|
||||
|
||||
# If set, use the chdir path
|
||||
if ( $self->config->{terminal_chdir} ) {
|
||||
my $chdir_path = $self->substitute_macros( $server,
|
||||
$self->config->{terminal_chdir_path} );
|
||||
|
||||
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': $!"
|
||||
);
|
||||
}
|
||||
# copy and amend the config provided to the helper script
|
||||
my $local_config = $self->config;
|
||||
$local_config->{command} = $self->substitute_macros( $server,
|
||||
$local_config->{command} );
|
||||
|
||||
my $exec = join( ' ',
|
||||
$self->config->{terminal},
|
||||
|
|
|
@ -63,9 +63,6 @@ my %default_config = (
|
|||
terminal_decoration_height => 10,
|
||||
terminal_decoration_width => 8,
|
||||
|
||||
terminal_chdir_path => $ENV{HOME} . '/.clusterssh/work/%s',
|
||||
terminal_chdir => 0,
|
||||
|
||||
console => 'console',
|
||||
console_args => '',
|
||||
rsh => 'rsh',
|
||||
|
|
|
@ -63,7 +63,6 @@ sub script {
|
|||
my \$port=shift;
|
||||
my \$mstr=shift;
|
||||
my \$command="$comms $comms_args ";
|
||||
my \$cwd=qx!pwd!;
|
||||
open(PIPE, ">", \$pipe) or die("Failed to open pipe: \$!\\n");
|
||||
print PIPE "\$\$:\$ENV{WINDOWID}"
|
||||
or die("Failed to write to pipe: $!\\n");
|
||||
|
@ -101,9 +100,7 @@ sub script {
|
|||
}
|
||||
\$command .= " ; $postcommand";
|
||||
# provide some info for debugging purposes
|
||||
warn("Running: \\n");
|
||||
warn(" pwd: \$cwd"); # already has newline
|
||||
warn(" cmd: \$command\\n");
|
||||
warn("Running: \$command\\n");
|
||||
exec(\$command);
|
||||
HERE
|
||||
|
||||
|
|
|
@ -28,8 +28,6 @@ isa_ok( $config, 'App::ClusterSSH::Config' );
|
|||
|
||||
Readonly::Hash my %default_config => {
|
||||
terminal => "xterm",
|
||||
terminal_chdir => 0,
|
||||
terminal_chdir_path => $ENV{HOME} . '/.clusterssh/work/%s',
|
||||
terminal_args => "",
|
||||
terminal_title_opt => "-T",
|
||||
terminal_colorize => 1,
|
||||
|
@ -519,9 +517,7 @@ is( $trap->stderr,
|
|||
|
||||
note('Checking dump');
|
||||
$config = App::ClusterSSH::Config->new(
|
||||
send_menu_xml_file => $ENV{HOME} . '/.clusterssh/send_menu',
|
||||
terminal_chdir_path => $ENV{HOME} . '/.clusterssh/work/%s',
|
||||
);
|
||||
send_menu_xml_file => $ENV{HOME} . '/.clusterssh/send_menu', );
|
||||
|
||||
trap {
|
||||
$config->dump();
|
||||
|
@ -574,8 +570,6 @@ terminal=xterm
|
|||
terminal_allow_send_events=-xrm '*.VT100.allowSendEvents:true'
|
||||
terminal_args=
|
||||
terminal_bg_style=dark
|
||||
terminal_chdir=0
|
||||
terminal_chdir_path=} . $ENV{HOME} . qq{/.clusterssh/work/%s
|
||||
terminal_colorize=1
|
||||
terminal_decoration_height=10
|
||||
terminal_decoration_width=8
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue