浏览代码

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

nilason 4 年之前
父节点
当前提交
962c7e59fb
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      lib/init/grass.py

+ 2 - 0
lib/init/grass.py

@@ -1800,6 +1800,8 @@ def sh_like_startup(location, location_name, grass_env_file, sh):
     f = open(shell_rc_file, 'w')
     f = open(shell_rc_file, 'w')
 
 
     if sh == 'zsh':
     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(
         f.write('test -r {home}/.alias && source {home}/.alias\n'.format(
             home=userhome))
             home=userhome))
     else:
     else: