Bug 208620 - Allow saving session output to file automatically without user interference
Summary: Allow saving session output to file automatically without user interference
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: history (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-26 18:10 UTC by Liang Guo
Modified: 2024-07-27 09:08 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 24.12.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Liang Guo 2009-09-26 18:10:08 UTC
Version:            (using KDE 4.3.1)
OS:                Linux
Installed from:    Debian testing/unstable Packages

Hi, I hope a new feature. 
when yakuake is started, all input and output can be logged to a file, just like logging function in putty. (I don't like use putty in Linux, for it's ugly in KDE environment.
Comment 1 Eike Hein 2009-09-26 18:22:13 UTC
Please note that the terminal area in Yakuake, along with its context menu, is provided by Konsole as a KPart component which Yakuake merely embeds.

Reassigning to Konsole.
Comment 2 Kurt Hindenburg 2009-09-26 19:43:34 UTC
Have you checked the ability to save the scrollback to a file?
Comment 3 Liang Guo 2009-09-27 16:28:01 UTC
(In reply to comment #2)
> Have you checked the ability to save the scrollback to a file?

I can save the scrollback to a file in konsole, It works fine. but each time I want log my session, I need explicitly use "scrollback -> save scrollback" to save my session, if I exit session without saving scrollback, all my session log dissappear. 

I hope Konsole /Yakuake can add a new feature, when Konsole/Yakuake is started, all my input and session output are saved to a logfile automatically, without my interference. 

Thanks
Comment 4 Liang Guo 2009-09-27 16:35:07 UTC
(In reply to comment #1)
> Please note that the terminal area in Yakuake, along with its context menu, is
> provided by Konsole as a KPart component which Yakuake merely embeds.
> 
> Reassigning to Konsole.

Hi,  Eike Hein

In Konsole I can use "scrollback -> save output" to save all output to a file, but I cannot find a corresponding menu or methord to save all scrollback.

Thanks.
Comment 5 Jekyll Wu 2011-08-19 06:53:32 UTC
This request sounds similar to #111691, although not the same.
Comment 6 Kurt Hindenburg 2024-03-26 23:52:02 UTC
This might be a valid request although no one has worked on in 13 years.
Comment 7 Bug Janitor Service 2024-06-21 11:46:49 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/1007
Comment 8 Kurt Hindenburg 2024-07-21 18:26:33 UTC
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