Re: Where are the /tmp/konsole-xxxxx.history files?

2020-11-12 Thread Stephen Dowdy

On 11/12/20 1:33 PM, Myriam Schweingruber wrote:

Hi,

On Thu, 5 Nov 2020 at 10:05, chiasa.men mailto:chiasa@web.de>> wrote:

kmail -v
kmail2 5.15.2 (20.08.2)

Earlier the konsole history was saved in /tmp/konsole-x.history. These
files seem to be gone (update?). The history still exists, so where is it
stored if not in /tmp/konsole-x.history?

I would never even have thought of looking in /tmp as that is often set to be 
erased when shutting down the computer. Also storing something system wide 
which should be user-specific makes little sense.

How about looking where it logically should be, namely ~/.bash-history ?


Seems to be a conflation with the user-input shell history and the scrollback 
history of the terminal going on here.

I think original request was for the scrollback history.  Here's how to get 
that info...

(ins)sdowdy@carrotcake$ pstree -Alpsa $$
systemd,1
  `-konsole,23071 --separate
  `-bash,5456
  `-pstree,6513 -Alpsa 5456

so, our parenting konsole for this shell is PID 23071, check the open files 
with 'lsof'...

(ins)sdowdy@carrotcake$ lsof -p 23071 | awk '$NF~/konsole.*\.history$/{print 
$NF}'
/run/user/7771/konsole-k23071.history
/run/user/7771/konsole-G23071.history
/run/user/7771/konsole-C23071.history
/run/user/7771/konsole-s23071.history
...

If i go into the Settings:

   Settings->Edit Current Profile->[Scrolling]->  switch from "unlimited scrollback" to 
"No scrollback"

then check again:

(ins)sdowdy@carrotcake$ lsof -p 23071 | awk '$NF~/konsole.*\.history$/{print 
$NF}'
(ins)sdowdy@carrotcake$

as expected (no more scrollback history files).

Note that this directory is ${XDG_RUNTIME_DIR} (part of FreeDesktop aka XDG) 
which is where applications are supposed to keep their runtime non-persistent 
data.
It defaults to (on my system)  /run/user/{uid} (user id)

now, the bigger question...   these generally aren't user-serviceable parts, so 
what exactly do you need to do with them?

--stephen


Re: Where are the /tmp/konsole-xxxxx.history files?

2020-11-12 Thread Myriam Schweingruber
Hi,

On Thu, 5 Nov 2020 at 10:05, chiasa.men  wrote:

> kmail -v
> kmail2 5.15.2 (20.08.2)
>
> Earlier the konsole history was saved in /tmp/konsole-x.history. These
> files seem to be gone (update?). The history still exists, so where is it
> stored if not in /tmp/konsole-x.history?
>
> I would never even have thought of looking in /tmp as that is often set to
be erased when shutting down the computer. Also storing something system
wide which should be user-specific makes little sense.

How about looking where it logically should be, namely ~/.bash-history ?

Regards, Myriam

-- 
Pronouns: she/her
Proud member of the Amarok and KDE Community:
https://www.kde.org
Protect your freedom and support the work of the FSFE:
https://www.fsfe.org