Bug 453935 - Inbuilt konsole always write to bash history
Summary: Inbuilt konsole always write to bash history
Status: RESOLVED FIXED
Alias: None
Product: kile
Classification: Applications
Component: user interface (show other bugs)
Version: 2.9.93
Platform: Arch Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: Michel Ludwig
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-17 12:44 UTC by Paul Péringuey
Modified: 2022-06-27 23:37 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Péringuey 2022-05-17 12:44:11 UTC
SUMMARY
When opening a tex file the inbuilt konsole send a cd and clear command which appear in bash_history.

STEPS TO REPRODUCE
1. Open tex file in kile.
2. Close it.
3. Open bash_history

OBSERVED RESULT
Two new entries in bash_history.

EXPECTED RESULT
No new entry.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: latest archlinux
(available in About System)
KDE Plasma Version: latest
KDE Frameworks Version: latest
Qt Version: latest

ADDITIONAL INFORMATION
It can be solve by adding in src/widgets/konsolewidget.cpp lines 134 and 135 a space at the beginning of the line, as does dolphin to prevent writing to bash_history if the option "ignorespace" is set in bashrc. These lines would then be

        m_term->sendInput(" cd " + KShell::quoteArg(directory) + '\n');
        m_term->sendInput(" clear\n");
Comment 1 Nicolas Fella 2022-06-27 23:37:07 UTC
Git commit cef2d4888250581420a7909bad5644a9c3c8dedb by Nicolas Fella, on behalf of Alessio Bonfiglio.
Committed on 27/06/2022 at 23:36.
Pushed by nicolasfella into branch 'master'.

Add white space before console commands in order to avoid save them into bash history

This avoids saving the `cd` and `clear` commands into the bash history if `ignorespace` is set in bashrc

Dolphin and Kate do the same in their Konsole integrations
Related: bug 391537

M  +2    -2    src/widgets/konsolewidget.cpp

https://invent.kde.org/office/kile/commit/cef2d4888250581420a7909bad5644a9c3c8dedb