Esempio n. 1
0
def _update_ps1():
  #ORIG_PS1 exits if we've already mucked with PS1
  if 'ORIG_PS1' in os.environ:
    ps1 = os.environ['ORIG_PS1']
  else:
    #TODO: PS1 gets removed?
    ps1 = r'\h:\w \u\$ '#os.environ['PS1']
    cfg.set_env_var('ORIG_PS1', ps1)
    
  import re
  
  cfg.set_env_var(
    'PS1',
    re.sub(
      r'(\[[\w ]+\])?\\\$',
      '['+cfg.get_file_var('cur_mode')+']\\$',
      ps1)
  )
Esempio n. 2
0
def mode():
  ret_val = cfg.get_file_var('cur_mode').split(' ')
  if ret_val == ['']:
    return []
  else:
    return ret_val