Skip to main content
11 events
when toggle format what by license comment
Jul 20, 2024 at 9:41 comment added Make42 I understand, yes, that is funny :-D and very relatable.
Jul 19, 2024 at 16:17 comment added Matthew Yes, I think you're right. I was remembering it is "backwards", but I think that's in the sense that you might expect '+' to turn it on (but 'set +x' is how you turn things off). But I'm sufficiently used to that that my attempt to "compensate" for recalling that it's "backwards" resulted in a double negation. 🙂
Jul 19, 2024 at 16:14 history edited Matthew CC BY-SA 4.0
turn off history correctly
Jul 19, 2024 at 10:03 comment added Make42 Regarding "what is the difference to waltinator's suggestion": Your solution works independently from where (konsole, start menu, etc.) I call kile.
Jul 19, 2024 at 10:01 comment added Make42 " set +o history - Does not write any of the current session to the log. Can be ran at any time during the session and will hide all commands. set -o history - Turns logging back on but logs the set command so obvious something has happened. "
Jul 19, 2024 at 9:57 comment added Make42 Shouldn't it be set +o history instead of set -o history? digi.ninja/blog/hiding_bash_history.php
Jul 17, 2024 at 17:21 comment added Matthew @Make42, looking at the output of ps --no-headers -o cmd will only work if the command-line used to invoke Kile is exactly kile, not /usr/bin/kile, kile <args...>, or a combination thereof. The version in the edit retains robustness against these, only discarding the test against any ancestor process. If you were to write it inline, you would write something like if [ $(ps --no-headers -o cmd $(ps --no-headers -o ppid $$)) == kile ] instead of the if ... shown in the Answer, but mind the caveats in the beginning of this comment.
Jul 17, 2024 at 17:16 history edited Matthew CC BY-SA 4.0
add "simplified" version
Jul 17, 2024 at 17:13 comment added Matthew @Make42, 1) waltinator's suggestion is to launch kile in an environment with history disabled. That probably works, but it's inconvenient, and will only help if you remember to use it every time. (That said, if you meant using the environment changes instead of set -o history, that might work also, but seems more round-about than set -o history.) 2) See edit. It would probably be beneficial to learn enough shell to understand how both functions actually work rather than just trusting what I wrote. 🙂
Jul 17, 2024 at 9:09 comment added Make42 Love the idea! Follow up questions: 1. From a practical standpoint: Do you think there are advantages to what waltinator suggests? 2. Would the ps --no-headers -o cmd $(ps --no-headers -o ppid $$) replace everything in the above code, or only the code in has_ancestor(){...}?
Jul 8, 2024 at 22:08 history answered Matthew CC BY-SA 4.0