mirror of
https://github.com/ovh/the-bastion.git
synced 2025-09-06 13:04:22 +08:00
fix: interactive mode: mark non-printable chars as such to avoid readline quirks
This commit is contained in:
parent
7008e385d2
commit
9c1870e990
1 changed files with 13 additions and 3 deletions
|
@ -20,9 +20,19 @@ sub interactive {
|
|||
my $interactiveModeTimeout = OVH::Bastion::config('interactiveModeTimeout')->value() || 0;
|
||||
my $slaveOrMaster = (OVH::Bastion::config('readOnlySlaveMode')->value() ? 'slave' : 'master');
|
||||
|
||||
my $term = Term::ReadLine->new('Bastion Interactive');
|
||||
my $prompt =
|
||||
"\001\033[0m\033[33m$self\033[1;35m@\033[32m\002$bastionName\001\033[1;35m\002(\001\033[0m\033[36m\002$slaveOrMaster\001\033[1;35m\002)\001\033[0m\033[32m\002>\001\033[0m\002 ";
|
||||
my $term = Term::ReadLine->new('Bastion Interactive');
|
||||
my $prompt = ""
|
||||
. "\001\033[0m\033[33m\002"
|
||||
. $self
|
||||
. "\001\033[1;35m\002" . "@"
|
||||
. "\001\033[32m\002"
|
||||
. $bastionName
|
||||
. "\001\033[1;35m\002" . "("
|
||||
. "\001\033[0m\033[36m\002"
|
||||
. $slaveOrMaster
|
||||
. "\001\033[1;35m\002" . ")"
|
||||
. "\001\033[0m\033[32m\002" . ">"
|
||||
. "\001\033[0m\002" . " ";
|
||||
|
||||
my $prompt_non_readline = $prompt;
|
||||
$prompt_non_readline =~ s=\001|\002==g;
|
||||
|
|
Loading…
Add table
Reference in a new issue