소스 검색

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

nilason 5 년 전
부모
커밋
1fdf7525e1
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  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')
     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: