OSGeo / grass

GRASS GIS - free and open-source geospatial processing engine
https://grass.osgeo.org
Other
791 stars 288 forks source link

[Feat] Change the history file according to the current mapset for tcsh #964

Open wenzeslaus opened 3 years ago

wenzeslaus commented 3 years ago

Is your feature request related to a problem? Please describe.

When changing mapset in tcsh (and csh?), g.mapset tell the commands to do to change history from one mapset to another. When the mapset is changed from the GUI, nothing is updated in the terminal.

Describe the solution you'd like

Shell should just do the change automatically on prompt update. This will be immediate when g.mapset is used from the shell and triggered by user updating the prompt in case of changing mapset from the GUI.

Additional context

This should be #930 (2d24a42cd4b6c66ab81348aa61240e784df39032), but for tcsh without the GUI part.

Identical issue for Z shell: #963.

susi commented 1 year ago

I can fix this for tcsh, and almost for csh. The almost part comes that for cash I can create an alias that will change the history file after running g.mapset, however this will only work if g.mapset is run from the shell, because csh doesn't provide support for precmd like tcsh does. Thus, if it's executed from the GUI then we have to ask the user to run the alias command.

@wenzeslaus Is there a way to detect in g.mapset if it's executed from the GUI? Can we maybe set a flag that is only set in the GUI (and maybe hidden from the user)? I'm thinking that we would only show this message when running in the GUI :thinking: