Download Padre

Session Management

Description

Padre recognizes the fact that people work on sets of files not necessarily belong to the same "project". Occasionally they might want to switch to another set of files. In Padre we call this Session Management.

When editing in Padre you can Save the set of currently opened files as a "Session" by pressing File -> Save Session... (or Ctrl+Alt+S) This will open a window listing the already saved sessions. (There is a default session called padre-last).

At this point you can either select the name of an existing session or you you can type in the name of a new session. You can also add a description for your convenience. Pressing Save will save the list of the currently open files. If you know close all the files you could return to the current situation by using Open Session via File -> Open Session... (Ctrl+Alt+O) and selecting the name of the desired session.

If you saved a session and open a few more files they will be added to the session only if you save the session again using the Save Session menu option.

At any time you are editing a bunch of files you can switch to a previously saved session using Open Session. This will close all the existing files and open those that were open when the other session was saved.

In order to make this feature even more useful you can tell padre to alway open a session when it starts. You can do it by setting Preferences -> Behaviour -> Open files: to session. If you have set this then every time you launch Padre it will first show you the list of saved sessions and you will be able to pick one of them to be opened. You can also press ESC to open Padre without any files.

You can also open padre with any session by running

padre --session='Session Name'

Test

  1. Start padre
  2. Open 3 files
  3. Save the session via File -> Save Session.. and call it Abc
  4. Close the middle tab
  5. Open a 4th file
  6. Open the session that you saved before by File -> Open Session (TODO: it probably should NOT close the files that are already open)
  7. Observer that the original 3 files are now open
  8. Close the middle tab again
  9. Open the 4th file again
  10. Press Ctrl+Alt+S
  11. You should see the Save Session dialog with the current session selected
  12. Save it
  13. Close all tabs (via File -> Close ... -> Close All Files)
  14. Open the earlier session by pressing Ctrl+Alt+O and selecting the name of the session
  15. Open the preferences window and set Preferences -> Behaviour -> Open files: to session
  16. Close padre
  1. Start Padre
  2. Observe there is a pop-up window listing all the sessions you saved
  3. Select session "Abc" and load
  4. Observe that the 4 files that we last open are opened again.
  5. Close Padre
  1. Start Padre with {{{ padre --session=Abc }}}
  2. Observe that Padre opens with the 4 files that were open earlier

TODO

  • Improve the speed at which Padre can switch between sessions.
  • Describe autosave of session and include it in the test case.