[pve-devel] [PATCH] reset tty when return form pct enter.

Dietmar Maurer dietmar at proxmox.com
Thu Sep 17 12:40:15 CEST 2015


this changes the exit code, so we cannot use that for exec

On 09/16/2015 01:31 PM, Wolfgang Link wrote:
> this is necessary to reactivate the echo of the input at some containers.
> ---
>   src/PVE/CLI/pct.pm | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/src/PVE/CLI/pct.pm b/src/PVE/CLI/pct.pm
> index 8c56f89..f8eac2e 100755
> --- a/src/PVE/CLI/pct.pm
> +++ b/src/PVE/CLI/pct.pm
> @@ -14,6 +14,7 @@ use PVE::API2::LXC;
>   use PVE::API2::LXC::Config;
>   use PVE::API2::LXC::Status;
>   use PVE::API2::LXC::Snapshot;
> +use PVE::Tools;
>   
>   use Data::Dumper;
>   
> @@ -95,7 +96,8 @@ __PACKAGE__->register_method ({
>   	# test if container exists on this node
>   	PVE::LXC::load_config($param->{vmid});
>   
> -	exec('lxc-attach', '-n',  $param->{vmid});
> +	system('lxc-attach', '-n',  $param->{vmid});
> +	exec('stty sane');
>       }});
>   
>   __PACKAGE__->register_method ({
> @@ -121,7 +123,9 @@ __PACKAGE__->register_method ({
>   	if (!@{$param->{'extra-args'}}) {
>   	    die "missing command";
>   	}
> -	exec('lxc-attach', '-n', $param->{vmid}, '--', @{$param->{'extra-args'}});
> +
> +	system('lxc-attach', '-n', $param->{vmid}, '--', @{$param->{'extra-args'}});
> +	exec('stty sane');
>       }});
>   
>   our $cmddef = {




More information about the pve-devel mailing list