Parcourir la source

init: ensure zsh environment variable SAVEHIST is set (#805)

nilason il y a 4 ans
Parent
commit
1fdf7525e1
1 fichiers modifiés avec 2 ajouts et 0 suppressions
  1. 2 0
      lib/init/grass.py

+ 2 - 0
lib/init/grass.py

@@ -1801,6 +1801,8 @@ def sh_like_startup(location, location_name, grass_env_file, sh):
     f = open(shell_rc_file, 'w')
 
     if sh == 'zsh':
+        if not os.getenv('SAVEHIST'):
+            os.environ['SAVEHIST'] = os.getenv('HISTSIZE')
         f.write('test -r {home}/.alias && source {home}/.alias\n'.format(
             home=userhome))
     else: