Set PSQLRC and PSQL_HISTORY env vars to apt. user storage path in the server mode. Fixes #6691

This commit is contained in:
Aditya Toshniwal
2021-08-23 16:19:01 +05:30
committed by Akshay Joshi
parent c64eb3507c
commit fbc6c30b62
3 changed files with 13 additions and 2 deletions

View File

@@ -109,6 +109,13 @@ def panel(trans_id):
# Set TERM env for xterm.
os.environ['TERM'] = 'xterm'
# If psql is enabled in server mode, set psqlrc and hist paths
# to individual user storage.
if config.ENABLE_PSQL and config.SERVER_MODE:
os.environ['PSQLRC'] = get_complete_file_path('.psqlrc', False)
os.environ['PSQL_HISTORY'] = \
get_complete_file_path('.psql_history', False)
o_db_name = _get_database(params['sid'], params['did'])
return render_template('editor_template.html',