Skip to content

Commit

Permalink
wxGUI: Use .wxgui_history as history file (OSGeo#1917)
Browse files Browse the repository at this point in the history
wxGUI (or the Console specifically) behaves now as another shell, so it keeps its own history. This creates consistent behavior regardless of the shell used in the terminal.  

Fixes OSGeo#962.
  • Loading branch information
susi authored and ninsbl committed Oct 26, 2022
1 parent 2784caa commit 81a8378
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion gui/wxpython/core/gconsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
@author Martin Landa <landa.martin gmail.com>
@author Vaclav Petras <wenzeslaus gmail.com> (refactoring)
@author Anna Kratochvilova <kratochanna gmail.com> (refactoring)
@author Wolf Bergenheim <wolf bergenheim.net> (#962)
"""

from __future__ import print_function
Expand Down Expand Up @@ -802,7 +803,7 @@ def UpdateHistoryFile(self, command):
env = grass.gisenv()
try:
filePath = os.path.join(
env["GISDBASE"], env["LOCATION_NAME"], env["MAPSET"], ".bash_history"
env["GISDBASE"], env["LOCATION_NAME"], env["MAPSET"], ".wxgui_history"
)
fileHistory = codecs.open(filePath, encoding="utf-8", mode="a")
except IOError as e:
Expand Down
3 changes: 2 additions & 1 deletion gui/wxpython/gui_core/prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
@author Martin Landa <landa.martin gmail.com>
@author Michael Barton <michael.barton@asu.edu>
@author Vaclav Petras <wenzeslaus gmail.com> (copy&paste customization)
@author Wolf Bergenheim <wolf bergenheim.net> (#962)
"""

import os
Expand Down Expand Up @@ -85,7 +86,7 @@ def _readHistory(self):
env["GISDBASE"],
env["LOCATION_NAME"],
env["MAPSET"],
".bash_history",
".wxgui_history",
),
encoding="utf-8",
mode="r",
Expand Down

0 comments on commit 81a8378

Please sign in to comment.