Version: 1.2.1 (using 4.2.4 (KDE 4.2.4), Debian packages) Compiler: cc OS: Linux (i686) release 2.6.30-1-686 In contrast to the former behavior of the terminal extension of Konqueror in KDE 3.5, any opening of a new window or change of a directory writes a clear or cd command to the bash history when the terminal view is open, so I don't find the relevant entries in the bash history.
The "cd"s are needed to keep the terminal panel in sync with the current directory in the view. If you don't want that, you can open an external terminal in KDE 4.3, see bug 164746. The "clear" command is supposed to hide the initial "cd" command. Removing it might be more annoying or irritating to most people than the "clear" in the history, I'm afraid...
If I remember correctly, the former Konqueror addon didn't write anything to the normal bash history, but kept its own history. So the problem was limited to the small shell within the file manager, where the additional cd and clear commands don't matter, as the shell in a file manager is more like a helper application than a normal shell where you are working. I think this behavior would be much more convenient. The other problem with the current implementation of the directory changes is that the command seems to be inserted even if the command line isn't idle. For exaple if you have a less <file> running and change the directory, you get a "Pattern not found (press RETURN)". It is even worse if you have an editor like vim running in the shell... The same problem you get if you have just typed in a (part of) a command and klick on a folder. Suppose you have your ripped music stored in a folder "cd", want to remove something else, just typing "rm -r " (perhaps because you need to do this as root) and click on a folder symbol (perhaps accidentially on the touch pad)... not a very funny imagination. You see, this problem reaches from annoying to extremely dangerous. Wouldn't it be possible to check if the command line is really free? Cheers, Simon
(In reply to comment #2) > The other problem with the current implementation of the directory > changes is that the command seems to be inserted even if the command > line isn't idle. This is bug 161637. > Wouldn't it be possible to check if the command line is > really free? I'm not a terminal expert, but I think this is not possible easily :-(
Setting the bash variable HISTFILE to a separate file (for example somewhere in the KDE settings) or even clear it completely would be a major improvement, so at least the normal bash history would be clean.
Yes, this is a bit annoying. Would it be possible to prevent all "cd" commands from being saved in bash history?
(In reply to comment #5) > Yes, this is a bit annoying. Would it be possible to prevent all "cd" commands > from being saved in bash history? A possible solution could be to prepend a blank to the automagically created "clear" and "cd" commands. At least when bash is used and HISTCONTROL includes ignorespace or ignoreboth, these commands will not be added to the history (see the bash man page). Perhaps it is also possible to add at least ignorespace for the newly started bash?
This seems to be very similar to a bug that I had wanted to originate, so instead of creating a new bug, I'll add some detail: dolphin terminal will (kind of) spontaneously eliminate half-entered command lines. This is a consequence of the 'feature' of the dolphin's terminal desire to always be in the folder reflected by the current focus of a panel elsewhere in dolphin. 01] open dolphin 02] f4 to open dolphin terminal 03] start to enter a long complicated command 04] f3 or ctrl-t and navigate to another folder 05] dolphin-terminal has replaced your unfinished command with a cd to the newly focused folder What should happen ================== 01] do nothing; don't change directory, don't mess with command-line - my first choice 02] save the half-entered command; perform the cd; restore the half-entered command; - my second choice 03] half-entered command line could be stored in history (not-executed, of course), before the cd.
(In reply to comment #6) > A possible solution could be to prepend a blank to the automagically created > "clear" and "cd" commands. At least when bash is used and HISTCONTROL > includes ignorespace or ignoreboth, these commands will not be added to the > history (see the bash man page). Perhaps it is also possible to add at least > ignorespace for the newly started bash? I must have missed this comment two years ago, sorry. We've discussed this issue on the kfm-devel-list this week and decided to prepend the commands with a space, as you suggested. The change will be in KDE 4.9: http://lists.kde.org/?t=133844952400003&r=1&w=2
Git commit 78e790cb0383ef88903b689d359318bb6ab5c984 by Frank Reininghaus. Committed on 03/06/2012 at 22:50. Pushed by freininghaus into branch 'master'. Prepend "cd" and "clear" commands with a space in the Terminal Panel This prevents that these commands, which have not been enetered by the user, but generated automatically, appear in the shell history, provided that the shell is configured appropriately. FIXED-IN: 4.9.0 M +2 -2 dolphin/src/panels/terminal/terminalpanel.cpp http://commits.kde.org/kde-baseapps/78e790cb0383ef88903b689d359318bb6ab5c984
So this will appear in 4.9?
thanks for the fix!
(In reply to comment #10) > So this will appear in 4.9? Yes, see the "Version Fixed In" field here in the bug report or the "FIXED-IN" keyword in the commit message.
*** Bug 312512 has been marked as a duplicate of this bug. ***