Module session
Session saving / loading functions
This module allows you to save your current session when quitting luakit, and then restore it again the next time you open luakit.
This module also provides a Lua API to allow other modules to save data to the session file and restore it when reopening Luakit.
Functions
session.save (file)
Save the current session state to a file.
If no file is specified, the path specified by session_file
is used.
Parameters
-
fileType: stringOptionalThe file path in which to save the session state.
session.load (delete, file)
Load session state from a file, and optionally delete it.
The session state is not restored. This function only loads the state into a table and returns it.
If no file is specified, the path specified by session_file
is used.
If delete
is not false
and the session file is not the recovery file,
then the session file is backed up into the recovery file.
Parameters
-
deleteType: booleanOptionalWhether to delete the file after the session is loaded.
-
fileType: stringOptionalThe file path from which to load the session state.
session.restore (delete)
Restore the session state, optionally deleting the session file.
This will first attempt to restore the session saved at session_file
. If
that does not succeed, the session saved at recovery_file
will be loaded.
If delete
is not false
, then the loaded session file is deleted.
Parameters
-
deleteType: booleanOptionalWhether to delete the file after the session is restored.
Return Values
-
tableThe window table for the last window created.
-
nilIf no session could be loaded,
nil
is returned.
Properties
session.session_file
session.recovery_file
Attribution
Copyright
- 2010 Mason Larobina