Bug 265165

Summary: using kile, bash history gets flooded with the commands cd 'working folder' and clear
Product: [Applications] kile Reporter: denk
Component: generalAssignee: Michel Ludwig <michel.ludwig>
Status: RESOLVED FIXED    
Severity: normal CC: denk, khindenburg
Priority: NOR    
Version: trunk-kde4   
Target Milestone: ---   
Platform: Debian unstable   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description denk 2011-02-02 09:26:26 UTC
Version:           trunk-kde4 (using KDE 4.5.3) 
OS:                Linux

During the usage of kile sometimes (not always, don't know how to reproduce) the bash history of the corresponding user gets flooded with the commands cd 'working folder' and clear. This is the case since some 2.1beta but I really don't know which one.

Regards
denk

Reproducible: Sometimes

Steps to Reproduce:
use kile, sometimes it happens, sometimes not

Actual Results:  
bash history contains commands which were executed by kile

Expected Results:  
bash history shouldn't contain those commands
Comment 1 denk 2011-04-04 16:47:05 UTC
It seems to me, that this behaviour is the same as in kate due to this bug:
https://bugs.kde.org/show_bug.cgi?id=225857

As the 'spamming' in history is really annoying and the above bug seems to be unregarded, could you please implement the possibility to deactivate the embedded terminal!? This is possible in Kate, as the terminal is implemented as a plugin which can be disabled.

Thanks in advance.

Regards
denk
Comment 2 denk 2011-04-04 21:22:04 UTC
It seems to me, that this behaviour is the same as in kate due to this bug:
https://bugs.kde.org/show_bug.cgi?id=225857

As the 'spamming' in history is really annoying and the above bug seems to be unregarded, could you please implement the possibility to deactivate the embedded terminal!? This is possible in Kate, as the terminal is implemented as a plugin which can be disabled.

Thanks in advance.

Regards
denk
Comment 3 denk 2011-06-13 01:55:40 UTC
Anything new on this?

As it is really annoying (at least for me) I did the following as a workaround:

1. create a bash script in the user's home directory with the following content:
#!/bin/sh

sed "/^cd '*'/{N;/clea$r/d}" ~/.bash_history > /tmp/kile_konsole_remove_history_helper_temp
mv /tmp/kile_konsole_remove_history_helper_temp ~/.bash_history
2. make the script executable
3. call the script in /etc/bash.bashrc (this works for Debian) with
PROMPT_COMMAND='~/.kile_konsole_remove_history_helper.sh'

This way the entries of kile's embedded konsole will be deleted from bash history after every command.
Comment 4 denk 2011-06-13 19:09:32 UTC
correction to my previous comment:

3. call the script in /etc/bash.bashrc with
if [ -x ~/.kile_konsole_remove_history_helper.sh ]; then                         PROMPT_COMMAND='~/.kile_konsole_remove_history_helper.sh'                         fi
Comment 5 Kurt Hindenburg 2011-11-19 21:54:36 UTC
I don't think this is KonsoleParts's issue.  The 'cd' part is coming from Kile.  The repeating might from calling ::sync()
Comment 6 Michel Ludwig 2011-11-20 12:29:29 UTC
I think it would be good if KonsolePart offered some way to close/restart the current shell. In that way, one could simply start a new shell when a new document is opened with a different initial working directory. One could avoid sending 'cd' commands in this way.

What do you think?
Comment 7 Michel Ludwig 2011-12-30 18:39:27 UTC
Git commit 07ec08000713d134fde43aebe9d0cdb37a9eadd7 by Michel Ludwig.
Committed on 30/12/2011 at 19:38.
Pushed by mludwig into branch 'master'.

Allow to configure whether the directory shown in the console is kept synchronized with the document tabs

M  +6    -2    src/kile.kcfg
M  +12   -5    src/widgets/generalconfigwidget.ui
M  +6    -1    src/widgets/konsolewidget.cpp

http://commits.kde.org/kile/07ec08000713d134fde43aebe9d0cdb37a9eadd7
Comment 8 Michel Ludwig 2011-12-30 18:45:28 UTC
Git commit e256a4828fe5747d5a2e01cc17700b43f7c188b8 by Michel Ludwig.
Committed on 30/12/2011 at 19:38.
Pushed by mludwig into branch '2.1'.

Allow to configure whether the directory shown in the console is kept synchronized with the document tabs

M  +6    -2    src/kile.kcfg
M  +12   -5    src/widgets/generalconfigwidget.ui
M  +6    -1    src/widgets/konsolewidget.cpp

http://commits.kde.org/kile/e256a4828fe5747d5a2e01cc17700b43f7c188b8