Bug 184788 - new tab behaves more like "clone" than "new"
Summary: new tab behaves more like "clone" than "new"
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Unspecified
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
: 185458 186716 211933 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-02-18 14:52 UTC by Jon Nelson
Modified: 2012-05-19 21:24 UTC (History)
12 users (show)

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


Attachments
patch to make new tab give a new default tab instead of cloning current (3.47 KB, patch)
2011-08-01 07:33 UTC, chris rouch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Nelson 2009-02-18 14:52:55 UTC
Version:            (using KDE 4.2.0)
Installed from:    SuSE RPMs

Have a .desktop file which starts an application (like ssh)
The .desktop file specifies that the application runs in a konsole
Execute the .desktop file

Now, with the konsole open, create a new tab.

konsole will re-exec ssh (instead of starting /bin/bash). This is undesireable!  Furthermore, if you control-c the ssh program, you'll get this:

Warning: Program '/usr/bin/ssh' crashed.

(it did not 'crash' - it exited normally)

and lastly, now the tab will not exit.

KDE 3.5 konsole did not do this.
Please fix!
Comment 1 Matthew Woehlke 2009-02-20 01:15:19 UTC
I think you can get around this by changing the Command (Settings->Edit Current Profile->General) to e.g. 'bash -l'. Otherwise, as you say, Konsole tries to "clone" the current tab.
Comment 2 Robert Knight 2009-02-20 13:45:18 UTC
Actually what happens is that Konsole is layering the command-to-execute setting specified in the .desktop file on top of the default settings and then using that combination as the default for new tabs in the window.

This is the same as if you had created a custom profile with that command and then started Konsole using the --profile argument to use that profile as the default for new tabs in the window.

This behavior makes sense sometimes - just not in Jon's particular case.
Comment 3 Marc Benstein 2009-03-18 17:05:53 UTC
*** Bug 185458 has been marked as a duplicate of this bug. ***
Comment 4 Daniel 2009-05-10 08:40:01 UTC
Then111 please make this bug CONFIRMED. This is an existing problem:
1. Create a new item with the Menu Editor.
2. Check the "Run in terminal" check-box on the new item's "Advanced" configuration page (still in the Menu Editor)
2a. Make sure that your default Terminal Emulator is Konsole. (System Settings / Default Applications / Terminal Emulator).
3. Run the created program from the K Menu and then create a new tab in the running Konsole.
4. In the new tab it will execute the program already running in the existing tab. <- this is the bug.

Please make this configurable at least.
A new option like "Always start new tabs with the default profile" would make sense: one could configure his/her default profile to start /bin/sh (like the already existing "Shell" profile), and then no matter what application is running in Konsole, it would start the default profile in the newly opened tab.
Comment 5 kjkuan 2009-06-01 08:13:48 UTC
another easy way to reproduce(in kde 4.2.3):

1) open konsole
2) run the command: konsole --new-tab -e ssh user@host
3) open a new tab
Comment 6 newsscott 2009-11-06 01:16:47 UTC
The default behaviour should be that "new tab" starts a new shell. I hate this bug. It traps me so often. Maybe an option to switch to current behaviour.

by the way: the same also applies to "new window".
Comment 7 Jon Nelson 2011-07-29 16:46:53 UTC
This remains very annoying and counter-intuitive.

What will it take to get this bug fixed?

(Still an issue as of 4.7.0 final)
Comment 8 chris rouch 2011-08-01 07:33:43 UTC
Created attachment 62410 [details]
patch to make new tab give a new default tab instead of cloning current

I've been using this patch since 4.5.3 up to 4.6.5 (i hope it will also work with 4.7, but not tested yet). I'm not a programmer, so this probably isn't good enough to be used as is, but maybe it's a starting point.
Comment 9 Jekyll Wu 2011-08-19 00:55:58 UTC
*** Bug 186716 has been marked as a duplicate of this bug. ***
Comment 10 Jekyll Wu 2011-08-19 00:56:40 UTC
*** Bug 211933 has been marked as a duplicate of this bug. ***
Comment 11 Jekyll Wu 2011-10-16 09:29:04 UTC
A recent commit has fixed this, but the commit message forgot to mention and close this bug. So paste the commit message here for record.

-------------------------------------------------------------------------

Git commit 35fae00159372bb332de54edba3a0cbbc22855f6 by Kurt Hindenburg.
Committed on 14/09/2011 at 05:26.
Pushed by hindenburg into branch 'master'.

When using -e <command> don't save to profile for new tabs.

    Currently using -e <command> will cause all new tabs/windows to run
    <command>.  This patch fixes that such that new tabs/windows will start
    the default profile.

    Patch by Gu Rui <chaos.proton@gmail.com> with minor edit by self.
    FIXED-IN: 4.8
    REVIEW: 102602
    CCBUG: 192212

M  +21   -16   src/Application.cpp

http://commits.kde.org/konsole/35fae00159372bb332de54edba3a0cbbc22855f6
-------------------------------------------------------------------------
Comment 12 Alon Bar-Lev 2012-05-19 21:03:56 UTC
Hello,

I think the result of this change is that now if I am in "Root" profile and press <Ctrl><Shift>T I always get the default profile.

Took me a while to be so annoyed to search for the cause of the regression.

I think that if I am within specific profile a new tab should clone this profile, so the old behvior was correctly, maybe to drop the -e, but keep the current active profile. Opening a new profile as always the default profile is unexpected.

Maybe an option to should be adde for people who like the default profile to be created always and for people who like the current profile to be cloned.

Thanks,
Alon.
Comment 13 Jekyll Wu 2012-05-19 21:22:39 UTC
(In reply to comment #12)
> Hello,
> 
> I think the result of this change is that now if I am in "Root" profile and
> press <Ctrl><Shift>T I always get the default profile.
> 
> Took me a while to be so annoyed to search for the cause of the regression.
> 
> I think that if I am within specific profile a new tab should clone this
> profile, so the old behvior was correctly, maybe to drop the -e, but keep
> the current active profile. Opening a new profile as always the default
> profile is unexpected.
> 
> Maybe an option to should be adde for people who like the default profile to
> be created always and for people who like the current profile to be cloned.
> 
> Thanks,
> Alon.

In the upcoming KDE SC 4.9, there will be an dedicated 'Clone Tab' action. I think two separate actions are easier to understand and more flexible  than making the semantic of an basic operation configurable.
Comment 14 Alon Bar-Lev 2012-05-19 21:24:17 UTC
(In reply to comment #13)
> In the upcoming KDE SC 4.9, there will be an dedicated 'Clone Tab' action. I
> think two separate actions are easier to understand and more flexible  than
> making the semantic of an basic operation configurable.

Thanks for the update!
I guess someone read my mind :)