Opened 2 years ago

Last modified 2 years ago

#3573 new enhancement

Save current working directory in wxGUI workspace and use it

Reported by: wenzeslaus Owned by: grass-dev@…
Priority: normal Milestone: 8.0.0
Component: Startup Version: unspecified
Keywords: workspace, recent, startup, wxGUI Cc:
CPU: Unspecified Platform: Unspecified

Description

When user changes current working directory in GUI, saves workspace, and reopens the same workspace, everything is there (especially after we have #2604) but the current working directory is the system default.

The current working directory should be stored in the workspace and then applied when starting.

It is not clear to me if only the GUI work dir should be changed or if also the command line should be changed (if it is during startup, it should be possible to change it for command line as well - considering that we need to read the workspace file for #2604).

Change History (6)

comment:1 in reply to:  description ; Changed 2 years ago by mlennert

Replying to wenzeslaus:

When user changes current working directory in GUI, saves workspace, and reopens the same workspace, everything is there (especially after we have #2604) but the current working directory is the system default.

The current working directory should be stored in the workspace and then applied when starting.

It is not clear to me if only the GUI work dir should be changed or if also the command line should be changed (if it is during startup, it should be possible to change it for command line as well - considering that we need to read the workspace file for #2604).

I have to admin that I never even noticed that we had this option. I find this a bit weird, first of all because I don't know what the "current working directory" actually means in GRASS GIS ? In the GUI I understand it to mean the directory that is opened by default in any file system widgets. Does it have any other effect ?

comment:2 in reply to:  1 ; Changed 2 years ago by wenzeslaus

Replying to mlennert:

I have to admin that I never even noticed that we had this option.

Accessible from Setting or using cd command in the Console tab (you basically get some consistency between terminal and Console tab).

I find this a bit weird, first of all because I don't know what the "current working directory" actually means in GRASS GIS?

It means just the same thing it means in the command line. Every program has current working directory (or whatever we want to call it). cd and $PWD or pwd in Linux command line, os.getcwd() and os.chdir() in Python.

In the GUI I understand it to mean the directory that is opened by default in any file system widgets.

Right. (At least that's how it works on Linux.) I usually forget about this behavior. This might be nice for some users and strange (but not necessarily confusing) to some others.

Does it have any other effect?

You can put all your files for import and all color tables for one project into one directory (and perhaps subdirs) and then just cd there and you don't need to use full path just a relative one. I guess that's clear, but the point is that it applies for terminal as well as the GUI Console tab. It is also advantageous when people are following commands in a list of instructions - you need to deal with specifying the path just once (and the exported files will be in the directory set at the beginning).

comment:3 Changed 2 years ago by wenzeslaus

I meant to link #3575 not #2604 although that's also related.

comment:4 in reply to:  2 ; Changed 2 years ago by mlennert

Replying to wenzeslaus:

Replying to mlennert:

I have to admin that I never even noticed that we had this option.

Accessible from Setting or using cd command in the Console tab (you basically get some consistency between terminal and Console tab).

I don't know what you mean by consistency, but when I cd in the console this (obviously) has no impact on the terminal pwd.

I find this a bit weird, first of all because I don't know what the "current working directory" actually means in GRASS GIS?

It means just the same thing it means in the command line. Every program has current working directory (or whatever we want to call it). cd and $PWD or pwd in Linux command line, os.getcwd() and os.chdir() in Python.

Yes, but here we have to be careful to be clear that when we say "program", we mean the GUI, not any GRASS module launched from anywhere.

In the GUI I understand it to mean the directory that is opened by default in any file system widgets.

Right. (At least that's how it works on Linux.) I usually forget about this behavior. This might be nice for some users and strange (but not necessarily confusing) to some others.

It is very nice, as I've had situations where I had to save multiple image versions of the GUI screen into one directory and had to navigate to that directory each time. Now I know that I can cd into that directory in the console and thus make it the GUI's pwd. :-)

Does it have any other effect?

You can put all your files for import and all color tables for one project into one directory (and perhaps subdirs) and then just cd there and you don't need to use full path just a relative one. I guess that's clear, but the point is that it applies for terminal as well as the GUI Console tab.

I don't know what you mean by "it applies" ? How ? IIUC your ticket, you are pleading for that it should ? But this would only be for the situation where the pwd is stored in a workspace, or ?

It is also advantageous when people are following commands in a list of instructions - you need to deal with specifying the path just once (and the exported files will be in the directory set at the beginning).

But you have to be very careful to make sure that all commands are executed either only in the console/GUI or only in the terminal...

comment:5 in reply to:  4 Changed 2 years ago by wenzeslaus

Replying to mlennert:

Replying to wenzeslaus:

Replying to mlennert:

I have to admin that I never even noticed that we had this option.

Accessible from Setting or using cd command in the Console tab (you basically get some consistency between terminal and Console tab).

I don't know what you mean by consistency, but when I cd in the console this (obviously) has no impact on the terminal pwd.

Consistency in that the directory can be changed both for terminal and for the Console in GUI.

I find this a bit weird, first of all because I don't know what the "current working directory" actually means in GRASS GIS?

It means just the same thing it means in the command line. Every program has current working directory (or whatever we want to call it). cd and $PWD or pwd in Linux command line, os.getcwd() and os.chdir() in Python.

Yes, but here we have to be careful to be clear that when we say "program", we mean the GUI, not any GRASS module launched from anywhere.

That's definitively something we could improve: putting it to a better place in menu, giving a better message when the change happens, ...

Does it have any other effect?

You can put all your files for import and all color tables for one project into one directory (and perhaps subdirs) and then just cd there and you don't need to use full path just a relative one. I guess that's clear, but the point is that it applies for terminal as well as the GUI Console tab.

I don't know what you mean by "it applies" ? How ? IIUC your ticket, you are pleading for that it should ? But this would only be for the situation where the pwd is stored in a workspace, or ?

The functionality to change the directory is already in GUI, so the benefits of it apply to GUI Console as well as terminal (where is it natively).

This ticket is just for the storing and loading from workspace.

It is also advantageous when people are following commands in a list of instructions - you need to deal with specifying the path just once (and the exported files will be in the directory set at the beginning).

But you have to be very careful to make sure that all commands are executed either only in the console/GUI or only in the terminal...

I switch between them all the time, but I don't see beginners doing that.

comment:6 Changed 2 years ago by wenzeslaus

The triplet database/location/mapset is now (v7.7) saved in the workspace (#3575). Adding also directory would give the user by opening a workspace the full previously set state in relation to access to data (GRASS maps and general files).

Note: See TracTickets for help on using tickets.