mirror of
https://github.com/webmin/webmin.git
synced 2026-03-20 08:40:24 +00:00
Add automatic option for command prompt color customization
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
base_port=555
|
||||
flavors=0
|
||||
flavors=2
|
||||
@@ -1,3 +1,3 @@
|
||||
base_port=Base port number for WebSockets connections,0,5
|
||||
size=Terminal width and height in characters,3,Automatic,5,,,Static (80x24)
|
||||
flavors=Enable inbuilt command prompt color customization,1,1-Yes,0-No
|
||||
flavors=Enable inbuilt command prompt color customization,1,2-Automatic,1-Yes,0-No
|
||||
|
||||
@@ -198,10 +198,14 @@ if ($user eq "root" && $in{'user'}) {
|
||||
&error(&text('index_euser', &html_escape($in{'user'})));
|
||||
$user = $in{'user'};
|
||||
}
|
||||
defined(getpwnam($user)) || &error(&text('index_euser', &html_escape($user)));
|
||||
my @uinfo = getpwnam($user);
|
||||
my $ushell_bash = $uinfo[8] =~ /\/bash$/;
|
||||
|
||||
# Terminal flavors
|
||||
my (@cmds, $term_flavors);
|
||||
if ($config{'flavors'}) {
|
||||
if ($config{'flavors'} == 1 ||
|
||||
$config{'flavors'} == 2 && $ushell_bash) {
|
||||
my ($cmd_lsalias, $cmd_ps1) = ("alias ls='ls --color=auto'");
|
||||
|
||||
# Optionally add colors to the prompt depending on the user type
|
||||
@@ -231,7 +235,6 @@ my $shellserver_cmd = "$module_config_directory/shellserver.pl";
|
||||
if (!-r $shellserver_cmd) {
|
||||
&cron::create_wrapper($shellserver_cmd, $module_name, "shellserver.pl");
|
||||
}
|
||||
defined(getpwnam($user)) || &error(&text('index_euser', &html_escape($user)));
|
||||
my $tmpdir = &tempname_dir();
|
||||
$ENV{'HISTCONTROL'} = 'ignoredups:ignorespace';
|
||||
$ENV{'SESSION_ID'} = $main::session_id;
|
||||
|
||||
Reference in New Issue
Block a user