Skip to content

Commit

Permalink
Add prompt color support using ANSI codes (Closes: #18) (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghantoos authored Nov 24, 2024
1 parent 1595757 commit be6f7cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions etc/lshell.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ loglevel : 2
#logfilename : syslog

## in case you are using syslog, you can choose your logname
#syslogname : myapp
#syslogname : lshell

## Set path to sudo noexec library. This path is usually autodetected, only
## set this variable to use alternate path. If set and the shared object is
Expand Down Expand Up @@ -76,7 +76,10 @@ aliases : {'ll':'ls -l'}
#intro : "== My personal intro ==\nWelcome to lshell\nType '?' or 'help' to get the list of allowed commands"

## configure your prompt using %u or %h (default: username)
#prompt : "%u@%h"
# prompt : "%u@%h"
## colored prompt using ANSI escape codes colors (light red user, light cyan host)
prompt : "\033[91m%u\033[97m@\033[96m%h\033[0m"


## set sort prompt current directory update (default: 0)
#prompt_short : 0
Expand Down
4 changes: 2 additions & 2 deletions lshell/checkconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def check_config_file(self, file):
self.stderr.write("Error: Config file doesn't exist\n")
utils.usage()
else:
self.config = configparser.ConfigParser()
self.config = configparser.ConfigParser(interpolation=None)

def get_global(self):
"""Loads the [global] parameters from the configuration file"""
Expand Down Expand Up @@ -307,7 +307,7 @@ def get_config_sub(self, section):
conf.append((key, self.conf[key]))

if self.config.has_section(section):
conf = self.config.items(section) + conf
conf = list(self.config.items(section)) + conf
for item in conf:
key = item[0]
value = item[1]
Expand Down

0 comments on commit be6f7cf

Please sign in to comment.