Bug 123731 - "show terminal emulator" in konqueror broken with PS1=$PS1"\[\e]31;\w\a\]"
Summary: "show terminal emulator" in konqueror broken with PS1=$PS1"\[\e]31;\w\a\]"
Status: RESOLVED UNMAINTAINED
Alias: None
Product: konqueror
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-16 17:22 UTC by Andreas Amann
Modified: 2012-01-07 17:34 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Amann 2006-03-16 17:22:03 UTC
Version:            (using KDE KDE 3.5.1)
Installed from:    Compiled From Sources
Compiler:          gcc 4.0.2 
OS:                Linux

according to one of the tips in the konsole tips file, I use 
export PS1=$PS1"\[\e]31;\w\a\]"' in my ~/.bashrc 

This however breaks the "Window->Show Terminal Emulator" function in a very weird way. To see what I mean do the following:

1) start konqueror
2) browse to your $HOME directory (i.e. press ctrl-HOME)
3) choose the menu "Window->Show Terminal Emulator" 
4) in the appearing terminal panel type:
  export PS1=$PS1"\[\e]31;\w\a\]"

This results in a list of printers shown in the original browser panel, which is surely not the expected behavior!
The terminal panel still remains open. 

If you have the export command in your .bashrc file, as recommended by the konsole tipfile, you get the strange printer panel as soon as you execute "Show Terminal Emulator" without further interaction.

The reason for this bug seems to  be in the member function

void KonqMainWindow::openURL( KonqView *childView, const KURL &url, const KParts::URLArgs &args )

which is defined in konq_mainwindow.cc.

I could work around the above bug with the following patch:


--- konq_mainwindow.cc_old      2006-01-19 17:02:09.000000000 +0000
+++ konq_mainwindow.cc  2006-03-16 16:18:36.000000000 +0000
@@ -955,7 +955,8 @@

   // Clicking on a link that points to the page itself (e.g. anchor)
   if ( !args.doPost() && !args.reload &&
-          childView && urlcmp( url.url(), childView->url().url(), true, true ) )
+          childView && urlcmp( url.url(), childView->url().url(), true, true ) &&
+       !(url.url().startsWith("file:")&& args.serviceType.isEmpty()))
   {
     QString serviceType = args.serviceType;
     if ( serviceType.isEmpty() )





however there might be a more elegant solution for this.
Comment 1 Andreas Amann 2006-03-16 19:35:24 UTC
Apparently this problem was also reported in 
http://bugs.kde.org/show_bug.cgi?id=119577

however the solution which was proposed there is in my opinion invalid. It was proposed  to simply remove the "\[\e]31;\w\a\]" string from the prompt, however this loses a very important functionality for bookmarking konsole sessions, and for following directory changes. 
In contrast to what was concluded in #119577 I think there is indeed a bug in konqueror. 

Comment 2 Thiago Macieira 2006-03-21 20:05:14 UTC
I cannot reproduce the problem in Konqueror 3.5.1 r512077.

When changing directories, the display in Konqueror changes too.
Comment 3 Andreas Amann 2006-03-22 14:51:25 UTC
Can you explain, what exactly you did? Maybe I did not express myself clearly enough. The bug is not about changing directories. Indeed typing "cd /tmp" works as expected and the Konqueror display follows. However if I go back to the directory at which the terminal emulator was started (in my case "cd ~" ), I get again the kdeprint_part display!

An easy way to trigger the bug is also:
1) start konqueror
2) press ctrl-HOME to browse your $HOME
3) select window -> show Terminal Emulator
4) in the shell type:
   > printf "\e]31;~\a"
5) boom, kdeprint_part gets started when it shouldn't

With the above patch in place, the problem does not occur. 
I just checked: This bug also happens with vendor packages from debian testing and fedora 4 (upgraded to kde-3.5.1).


with the above patch applied, everything


Comment 4 Thiago Macieira 2006-03-22 17:16:57 UTC
I can reproduce this using the instructions from comment #3.
Comment 5 Rui G. 2008-05-20 21:07:32 UTC
I can reproduce it in 3.5.9 . However currently trunk r810100 does not have the terminal emulator working in konq4. Calling the terminal emulator in dolphin ( with F4, couldn't find in the menu ) and following the first instructions doesn't show the printer list or something unusual.
Comment 6 Jekyll Wu 2011-12-30 15:55:00 UTC
I can't reproduce the reported problem in KDE SC 4.8 RC1 using the steps in comment #3.
Comment 7 Dawit Alemayehu 2012-01-07 17:34:46 UTC
KDE 3 is no longer maintained and the issue as stated in comment #6 cannot be reproduced under the latest version of KDE 4.