]> git.proxmox.com Git - pve-container.git/blobdiff - src/PVE/CLI/pct.pm
close #1940: pct console: added ability to specify escape sequence
[pve-container.git] / src / PVE / CLI / pct.pm
index 6296d6fc9aaa3b62d4d0b10ba5e6a1a45723d9f5..9d3a2301ff3b6a6da61bde3064188d6609cd68e5 100755 (executable)
@@ -119,6 +119,13 @@ __PACKAGE__->register_method ({
        additionalProperties => 0,
        properties => {
            vmid => get_standard_option('pve-vmid', { completion => \&PVE::LXC::complete_ctid_running }),
+           escape => {
+               description => "Escape sequence prefix. For example to use <Ctrl+b q> as the escape sequence pass '^b'.",
+               default =>  '^a',
+               type => 'string',
+               pattern => '\^?[a-z]',
+               optional => 1,
+           },
        },
     },
     returns => { type => 'null' },
@@ -129,7 +136,7 @@ __PACKAGE__->register_method ({
        # test if container exists on this node
        my $conf = PVE::LXC::Config->load_config($param->{vmid});
 
-       my $cmd = PVE::LXC::get_console_command($param->{vmid}, $conf);
+       my $cmd = PVE::LXC::get_console_command($param->{vmid}, $conf, $param->{escape});
        exec(@$cmd);
     }});