Bug 75653 - Moving shells between konsole sessions
Summary: Moving shells between konsole sessions
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
: 101652 146350 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-02-19 23:25 UTC by Sean Crago
Modified: 2008-06-16 19:30 UTC (History)
3 users (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 Sean Crago 2004-02-19 23:25:22 UTC
Version:           Konsole 1.3, KDE 3.2.0 (using KDE KDE 3.2.0)
Installed from:    Compiled From Sources
Compiler:          gcc version 3.3.2 20031218 (Gentoo Linux 3.3.2-r5, propolice-3.3-7) 
OS:          Linux

I have a suggestion that might not be feasible to implement.  

It'd kick ass to be able to move shell a between konsole sessions.  I often have 4-6 shells running in 2 or 3 sessions of konsole, to keep everything logically separate.  E.g. a development desktop, a desktop with wine, mplayer, gaim, etc running out of site, out of mind, and each with a shell in that desktop's konsole session, etc.

However, when I finish one set of tasks, I often have one little shell running, say with wine or mkisofs, a video encoder, etc. that I don't want to kill, but that doesn't warrant the screen real-estate.  In that particular kind of case, this requested feature would really feel nice.

It might work, however, if each shell within a konsole session is or can be easily made to work as a separate task.  This would allow for the last shell of a konsole to be detached, if the konsole stuff around the shell is also a separate task.

Note that this might also make a tiny detached konsole able to run w/less memory or other resources too.

I know this is a kind of weird request, but I hope it is useful.

Thanks
Comment 1 Seth LaForge 2004-03-09 21:22:42 UTC
I'll second this request.  I'll also propose a UI: make session tabs drag-and-droppable.  If you drag a session tab to another konsole window, the session would move to that window.  If you drag a session tab within a single konsole window, you could reorder the session tabs.

Also, to make things more consistent, you could get rid of the "Detach Session" feature (which is kind of odd), and replace it with a "Move Session to New Konsole", which would start up a new Konsole and move the current session to it.

How hard is this to implement?  I haven't done enough pseudo-tty work to know...

Perhaps a good way to implement this feature would involve borrowing some code from screen.  As a nice side-effect, konsole could be partially integrated with screen, as suggested in wishlist bugs #58868 and #27089.
Comment 2 Kurt Hindenburg 2005-01-04 15:44:58 UTC
1. New Window - creates a new separate konsole window (New in 3.4)
2. Detach Session is still there - creates a new separate window.
   Re-Attach Session (after being detached) has been dropped.
3. View->Move Session Left|Right will move the shells...

Moving sessions between konsole window's seems a little extreme; using 'screen' would seem the best solution.
Having the tabs be d-n-d might be possible, but perhaps not worth the effort (since you can use #3 to do the same thing).
Comment 3 Joseph Garvin 2005-05-31 23:25:21 UTC
Drag and Dropping tabs between sessions is the best option I think. It's easier and more intuitive than using Screen, and it's important for a usability reason: interface consistency. If I can drag and drop tabs between konqueror windows, why shouldn't I be able to do the same with Konsole tabs?
Comment 4 Nigel Stewart 2005-06-26 03:44:59 UTC
I would also like to drag and drop a konsole session into
a Konqueror tab, or vice versa.

This would be a nice way to organise projects into tabs
into konsole sessions on different virtual desktops.
Comment 5 Jesus Cea 2005-11-20 23:43:00 UTC
I vote for this wishlist.
Comment 6 gsasha 2006-07-27 12:59:05 UTC
This is a great idea (and actually a very natural thing to have).
Now about moving shell sessions to Konqueror tabs, I think there can be even more integration. Consider: when running a kwrite from a Konsole (OK, not exactly THAT, it would be somewhat confusing), but perhaps "kwrite-inline file.txt" would open the editor window on top of the shell session, the closing of which would return back to the shell...

This is similar to using vi for quick edits on a file - but kwrite is somewhat more user-friendly than VI (don't flame me... I'm using VI in some cases...).

Now, I'm not sure this is implementable or easy to do - but it would be a great environment to work with.
Comment 7 Wolfram R. Sieber 2006-08-02 22:04:19 UTC
Seth,

> make session tabs drag-and-droppable.  If you drag a session tab
> to another konsole window, the session would move to that window.
> If you drag a session tab within a single konsole window, you
> could reorder the session tabs.

Hm, since konsole implicitely requires having ones hands on the keyboard, I just went comfortable with reordering the console tabs by Ctrl+Shift+Left/Right. On the other hand, sometimes I "extract" a konsole tab from a konsole window, right to the desktop (instead of to another konsole window), making it a single window.

I'd like to see a drag and drop functionality for the konsole to additionally support dropping konsole tabs to the desktop, implicitely launching a new konsole window to place the tab there.
Comment 8 Robert Knight 2007-12-16 07:40:54 UTC
*** Bug 101652 has been marked as a duplicate of this bug. ***
Comment 9 Wolfram R. Sieber 2007-12-16 15:12:45 UTC
the initial reporter, Sean:

I just noticed a shell tool named "screen" which -- as far as I recognized so far -- wraps a bash or other. If you login to a remote system and use shell, you can launch there processes (e.g. cdrecord), log out then and when logging in later again, you can continue where you stopped, i.e. the logout doesn't kill the (e.g. cdrecord) process.

I think using (parts of) screen might help to fulfill the original request. 

... 

But I am not sure, hence consider this only as a note please. :-)
Comment 10 Robert Knight 2008-01-04 00:30:35 UTC
*** Bug 146350 has been marked as a duplicate of this bug. ***
Comment 11 Space Muffin 2008-04-14 21:48:26 UTC
Another useful (for me) feature in this vein would be to a permit multilevel tab lists - for when you have too many tabs to fit into one level and don't want to scroll left/right to see them all:
___________________
|                 |
| $               |
|                 |
|[tab|tab|tab|tab]|
|[tab|tab|tab|tab]|
-------------------

Any chance either tab reattach or tab migration will be in KDE 4.2+ ? (I am still running Konsole 1.4.1..waiting for tab reattach to return.)
Comment 12 Robert Knight 2008-04-14 21:58:05 UTC
> Another useful (for me) feature in this vein would be to a permit multilevel tab lists 

Once you get to that many sessions I think tabs are no longer a suitable UI.  In early versions of KDE 4 Konsole used a list at the side of the screen (like Kate) which is probably better suited to very large numbers of sessions.

Comment 13 Space Muffin 2008-04-14 22:01:43 UTC
Ah, yes, that would be even better!

You say in "early versions" of KDE 4..does that mean the current KDE 4 Konsole does not have Kate-like lists?
Comment 14 Robert Knight 2008-04-14 22:12:30 UTC
> You say in "early versions" of KDE 4..does that mean the current KDE 4 Konsole does not have Kate-like lists? 

That is correct.  It was an experimental feature which I haven't yet completed.
Comment 15 Wolfram R. Sieber 2008-04-15 00:53:55 UTC
Well, if you want to handle that many tabs, it might be useful if you could group them together ... maybe even something similar to the main window list on kicker?
Comment 16 Space Muffin 2008-04-15 02:21:42 UTC
That's a good idea..I would not object to tab grouping, as long as it could be configured (i.e., not mandatory after a certain number of tabs.) But in general, the more I think about, the more I like the idea.
Comment 17 Robert Knight 2008-04-15 12:38:24 UTC
SVN commit 797287 by knight:

Support drag-and-drop of tabs between windows and containers, with drop indicator
arrow and 'torn-off' tab while moving.

(Drag and drop between windows is supported only for windows within the same process,
which will be all windows opened from a GUI)

Some of this functionality could be moved to kdelibs / KTabBar for the benefit of other
applications.

BUG: 75653

Squashed commit of the following:

commit 1e5b628b74f4c7182b1aed159088f0d449bf6f1f
Author: Robert Knight <robertknight@gmail.com>
Date:   Tue Apr 15 11:32:04 2008 +0100

    Set drop indicator label to same size as pixmap.

commit 59ad9200465cfb76651ce81abd3ba20e2fdd3067
Author: Robert Knight <robertknight@gmail.com>
Date:   Tue Apr 15 11:14:41 2008 +0100

    Adjust drop indicator for north and south tabs.

commit 01ba5bca9457bc19156f5a87ad6967fac7cc3c1e
Author: Robert Knight <robertknight@gmail.com>
Date:   Tue Apr 15 11:06:52 2008 +0100

    Display a drop indicator arrow at the position where the tab will be dropped.

commit 137ade01d70d75d26f3c14624ec2c096c8c50eba
Author: Robert Knight <robertknight@gmail.com>
Date:   Tue Apr 15 10:01:28 2008 +0100

    Update detach view action state when moving tabs between windows.

commit 412c2d16844afda3f0427a5583d653c2214722fb
Author: Robert Knight <robertknight@gmail.com>
Date:   Tue Apr 15 09:56:37 2008 +0100

    Move mimetype definition to ViewProperties

commit dc31499351ef564cfe75c25124c3549b5dc75e16
Author: Robert Knight <robertknight@gmail.com>
Date:   Tue Apr 15 02:26:03 2008 +0100

    Hack around crash which can occur after a drag-and-drop tab move causes a view container to be destroyed, taking the QDrag object with it.  Fix this by setting the QDrag's parent object to 0 before calling removeView().  This leaks the QDrag however.

commit df057fd06988bcd2b4c0f21e1d746543e7cfe1c5
Author: Robert Knight <robertknight@gmail.com>
Date:   Tue Apr 15 02:24:21 2008 +0100

    Fix jumps based on uninitialized variables.

commit 864bfcc2e8c63e2c8a9b6e9c96bc4d90d3dacd7e
Author: Robert Knight <robertknight@gmail.com>
Date:   Tue Apr 15 00:20:12 2008 +0100

    Make the initiator of the tab drag event remove the view.  Change newViewRequest() -> moveViewRequest().  Do not delete the view if the tab is dropped onto another application which blindly accepts it.

commit b922858420d4b61ad2727c64bc885042280d65f4
Author: Robert Knight <robertknight@gmail.com>
Date:   Mon Apr 14 23:29:18 2008 +0100

    Add support for drag-and-drop moving of tabs between any two tab bars in the same process.


 M  +2 -1      SessionController.cpp  
 M  +2 -0      SessionController.h  
 M  +1 -0      TerminalCharacterDecoder.cpp  
 M  +1 -0      TerminalDisplay.cpp  
 M  +179 -19   ViewContainer.cpp  
 M  +41 -10    ViewContainer.h  
 M  +47 -28    ViewManager.cpp  
 M  +6 -1      ViewManager.h  
 M  +16 -1     ViewProperties.cpp  
 M  +13 -5     ViewProperties.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=797287
Comment 18 Space Muffin 2008-04-15 14:41:22 UTC
Thank you! Can't wait to try it out.
Comment 19 Wolfram R. Sieber 2008-06-16 19:30:34 UTC
Thank you from my side too!