[Bug #12958] History same for all tabs after restoring a saved session
Boris Astardzhiev
boris.astardzhiev at gmail.com
Sun Mar 8 19:01:30 CET 2020
Hello,
As a continuation of this bug.
https://bugzilla.xfce.org/show_bug.cgi?id=12958
I've always wanted xfce4-terminals to preserve scrollback history across
reboots/logouts.
Sometimes I omit powering off my machine only due to the fact that I will
lose history across terminals as I have many of them. Unfortunately this is
not green at all. Moreover if I do shutdown my machine the next day it's
pretty hard to restart my work the way it was prior to shutdown. Yes, there
are instruments like tmux/screen (and yes I use them myself) but they may
be a burden for ordinary users.
Please consider the following patch. It basically does:
1) Scrollback history is saved across logouts/reboots if enabled via
xfce4-terminal's preferences and if 'Save session for future logins' is
checked.
2) Environment variable TAB_ID is exported in every terminal screen. It's a
16 character version of a SHA256 checksum. A seed identical to role-id is
used for the generation of the checksum.
3) Scrollbacks are private to the user itself. They're stored in
~/.cache/xfce4/terminal/. They're GZIP compressed as well. Saving is done
immediately on logging out which is tied to the 'save-session' event.
4) On logging in and after restoration scrollback files are deleted.
5) Since such histories may expose sensitive data everything is
configurable and can be disabled thus no scrollback files will be saved at
all.
6) It's up to the user to decide what fits him/her best and if this
violates security or other implications user can omit using it.
As a future work, I think shell history may be tied per terminal. When time
permits I can go and investigate this idea further. I think this will be a
nice add-on to this feature.
Please share your opinions and provide some code review if you're
positively inclined to incorporating this feature.
Regards,
Boris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.xfce.org/pipermail/xfce/attachments/20200308/b548b9ed/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Restore-scrollback-history-on-save-session.patch
Type: text/x-patch
Size: 25428 bytes
Desc: not available
URL: <https://mail.xfce.org/pipermail/xfce/attachments/20200308/b548b9ed/attachment-0001.bin>
More information about the Xfce
mailing list