[konsole] [Bug 208620] Allow saving session output to file automatically without user interference
Kurt Hindenburg
bugzilla_noreply at kde.org
Sun Jul 21 19:26:33 BST 2024
https://bugs.kde.org/show_bug.cgi?id=208620
Kurt Hindenburg <khindenburg at kde.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Latest Commit| |https://invent.kde.org/util
| |ities/konsole/-/commit/ae22
| |2d8eb5826169dbe0626461156fb
| |4f7f5fb70
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #8 from Kurt Hindenburg <khindenburg at kde.org> ---
Git commit ae222d8eb5826169dbe0626461156fb4f7f5fb70 by Kurt Hindenburg, on
behalf of Theodore Wang.
Committed on 21/07/2024 at 18:26.
Pushed by hindenburg into branch 'master'.
Added autosave functionality
The autosave functionality is contained in a SaveHistoryAutoTask
class, which inherits from SessionTask. The autosave mechanism
hinges on two pieces of information regarding the autosave file:
the number of bytes used to store the contents of dropped lines
(represented by SaveHistoryAutoTask::_droppedBytes) and a list
of byte offsets corresponding to the start of the contents of lines
on the screen (represented by SaveHistoryAutoTask::_bytesLines).
Everytime a line is dropped, SaveHistoryAutoTask::_droppedBytes
is updated using _bytesLines. Everytime the output is read and
saved to file, the autosave file is resized to _droppedBytes and
the current screen output is appended. Everytime the output is read
or the screen is resized, _bytesLines is updated.
The autosave can be started using an "Auto Save Ouput As" button in
the "File" tab of the toolbar. Once the autosave is started, said
button is replaced by a "Stop Auto Save" button which allows the
user to stop the autosave. Internally, any errors encountered by
the program would result in an KMessageBox reporting the details of
the error and stopping the autosave as well. Clicking on the stop
button reveals the start button again.
Similar to SaveHistoryTask, there is a file dialog which allows the
user to choose which file they would like the autosave contents to
be stored in.
Apart from errors involving reading session output and writing to
file, modifying the file externally, renaming the file and deleting
the file will also result in an error. Emulation::_currentScreen
being changed will also result in an error.
The autosave is conducted at a fixed time interval, apart from an
edge case where an autosave is required immediately due to internal
constraints. Said fixed time interval can be set by the user in the
settings of their current profile, specifically the "Advanced" tab.
Details on the internals of the autosave functionality is documented
in the source files.
GUI
M +2 -0 desktop/sessionui.rc
M +1 -0 src/CMakeLists.txt
M +10 -0 src/Emulation.cpp
M +9 -0 src/Emulation.h
A +259 -0 src/SaveHistoryAutoTask.cpp [License: GPL(v2.0+)]
A +119 -0 src/SaveHistoryAutoTask.h [License: GPL(v2.0+)]
M +84 -2 src/Screen.cpp
M +5 -0 src/Screen.h
M +2 -0 src/Vt102Emulation.cpp
M +1 -0 src/profile/Profile.cpp
M +3 -0 src/profile/Profile.h
M +36 -0 src/session/SessionController.cpp
M +7 -0 src/session/SessionController.h
M +20 -0 src/widgets/EditProfileAdvancedPage.ui
M +8 -0 src/widgets/EditProfileDialog.cpp
M +1 -0 src/widgets/EditProfileDialog.h
https://invent.kde.org/utilities/konsole/-/commit/ae222d8eb5826169dbe0626461156fb4f7f5fb70
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the konsole-devel
mailing list