Simultaneous typing

Bug #246297 reported by Pawel
8
Affects Status Importance Assigned to Milestone
Terminator
Fix Released
Wishlist
Chris Jones

Bug Description

It would be very handy to have possibility to type simultaneously to chosen terminals.
Example uses: invoking ssh connection to same host many times, entering the same directory using 'cd'.

I can imagine it to work like this:
1. Press and hold some hot-key combination to activate terminal selection mode.
2. Select terminals (clicking on chosen ones with mouse while holding hot-key combination)
3. Release hot-key combination.
3. Start typing and observe text appearing in every chosen terminal :)
4. Click on any terminal to select it and deselect the rest. Or press and hold hot-key combination to select/deselect other terminals.

Revision history for this message
Chris Jones (cmsj) wrote :

Definitely a worthwhile idea, thanks for the suggestion.

Changed in terminator:
importance: Undecided → Wishlist
milestone: none → 1.0-beta
status: New → Confirmed
Revision history for this message
Stephan Rügamer (sruegamer) wrote :

Hi,

yes, something what cluster-ssh does :)

I +1 this idea...please raise prio ;)

Regards
\sh

Revision history for this message
Markus Korn (thekorn) wrote :

I was always looking for such a feature :)
From what I've seen of the code, I think this should be easy to implement, let me try...

Markus

Changed in terminator:
assignee: nobody → thekorn
Revision history for this message
Markus Korn (thekorn) wrote :

I started working on this, the current shortcut for initiating the selection of terminals is <Control>+<Shift>+M
selection can be reverted by <ESC>

There is currently no visual marks on selected terminals, work in progress :)

I'm happy t hear any kind of suggestions and critique

Markus

Revision history for this message
Nicolas Valcarcel (nvalcarcel) wrote :

isn't cntrl+shift+M maximize terminal?

Revision history for this message
Chris Jones (cmsj) wrote : Re: [Bug 246297] Re: Simultaneous typing

Hi

Nicolas Valcárcel (nxvl) wrote:
> isn't cntrl+shift+M maximize terminal?

no, that's ctrl-shift-x (because it's next to ctrl-shift-z on my keyboard)

Cheers,
--
Chris Jones

Revision history for this message
Markus Korn (thekorn) wrote :

well, I think I will change this shortcut soon, because ctrl-shift-m needs some finger-acrobatics but I did not find another not used shortcut yesterday.

Markus

Revision history for this message
Markus Korn (thekorn) wrote :

I think I finished this In the recent rev of the attached branch, I did not change the shortcut.

* holding ctrl-shif-m to select/deselect terminal-widgets
* pressing ESC to deselect all

See the attached video!
Suggestions are always welcome.

Markus

Revision history for this message
Markus Korn (thekorn) wrote :

New version, now with grey overlay for grouped terminals

Revision history for this message
Chris Jones (cmsj) wrote :

Markus: this is looking really good, thanks very much! Do you want to merge this and work on it in trunk, or do you think it still needs significantly more work before merging?

Revision history for this message
chantra (chantra) wrote :

Yeah, looks real good, and the grey tab is definitely a + coz otherwise
you would just be lost.

This make me think that I could work on a the title bar a bit more so it
reflects the environment a bit better. Like if wether or not the tab is
grouped (simultaneous typing), if the term is zoomed or not ....

Also, regarding keybindings, I wonder if they are the same on any
language, there should be some spec around.... at least for the common
keybindings.

On Thu, 2008-07-10 at 16:16 +0000, Chris Jones wrote:
> Markus: this is looking really good, thanks very much! Do you want to
> merge this and work on it in trunk, or do you think it still needs
> significantly more work before merging?
>
--
http://www.debuntu.org

Debuntu deb's repository

Revision history for this message
Nicolas Valcarcel (nvalcarcel) wrote :

Also can you add a menu entry for the shorcut, so if i can't use that keybinding (in my machine it opens evolution) i can still be able to use it.

Chris Jones (cmsj)
Changed in terminator:
milestone: 1.0-beta → 0.9.1
Revision history for this message
Chris Jones (cmsj) wrote :

hmm, I just tried the branch and didn't get much joy from it. I need to look into it further to figure out why it wasn't working.
As a more general comment, I wonder if it wouldn't be possible to make the expose event handler be added only when it is needed, and then removed when simultaneous typing isn't enabled, otherwise that function is fired quite often (e.g. having cursor blink enabled causes an expose event for every cursor state change).

Perhaps ctrl-shift-m could place terminator into a state where it will join terminals, and then pressing escape would make it leave that state, rather than having to hold down the shortcut?

Chris Jones (cmsj)
Changed in terminator:
milestone: 0.9.1 → 1.0-beta
Revision history for this message
Lee Johnson (lee-johnson) wrote :

Any progress / news on this? I checked the branch out a couple of weeks ago and have had a little play around with it. It seems to be working, but not without some bugs. I have a couple of weeks off over Christmas and plan to look into if further then.

Revision history for this message
Markus Korn (thekorn) wrote :

I did not find any time to work further on this feature, I also planned to look at it over the holidays.
Lee, I won't mind if you also look into it, so we can share ideas etc.

One of the biggest problems I had when I tried to work on this two weeks ago was to understand the code I wrote in this branch and all the changes made to trunk since then.

Markus

Revision history for this message
Lee Johnson (lee-johnson) wrote :

It might be worth making a fresh branch from trunk given it's been a while since the og branch has been looked at. Will probably make a merge back less painful. AFAICT, from a quick look over the branch code, there isn't really much code involved in making this work and the majority of the code added handles the grey overlay. Like Chris, I couldn't get the CTRL-SHIFT-M to work so I manually set self.__hijacked = True in terminatorterm.py to play around with it.

Revision history for this message
Chris Jones (cmsj) wrote :

I read over the diff of "bzr merge --preview" for trying to merge this branch into trunk. It's not diverged as much as I expected.

However, I think if work is going to go into this feature again we should look at exactly how it works.

With features like this I try to imagine both the simple use case of someone with 2 or 3 splits, as well as the use case of someone with a huge monitor and dozens of splits.
It occurs to me that the latter use case may well like the idea of having multiple groupings, which means:

 * we need to track which grouping a terminal is in
 * we need to display which grouping a terminal is in (my suggestion would be to force display of the titlebar and put the information in there)

I would also like to explore if it's possible to be able to type into any terminal of a given group, rather than specifying one as a "master".

Revision history for this message
Chris Jones (cmsj) wrote :

I did some hacking last night on the groundwork of some UI ideas that would cover my comments in the previous bug.
The branch is based off current trunk: lp:~cmsj/+junk/new-simultaneous-typing

Revision history for this message
Chris Jones (cmsj) wrote :

There should be a little UI cleanup at some point, but I have just merged my code into trunk to support arbitrary groupings of terminals.
Be aware that apart from internal key bindings, *everything* is sent to grouped terminals, including ^D.

Changed in terminator:
status: Confirmed → Fix Committed
Revision history for this message
Lee Johnson (lee-johnson) wrote :

Sounds good. It makes complete sense to me for all but internal key bindings to be sent to grouped terminals, it's wouldn't be intuitive for it to work any other way. I'll try to check out trunk sometime early next week and have a play around.

Revision history for this message
Lee Johnson (lee-johnson) wrote :

Just checked this out, looks super. Any suggestions for UI improvements / cleanup I could look into? I think being able to save/load groupings would be a good addition: open a saved grouping in a tab running a specific command (ssh) in each split window for example?

Revision history for this message
Chris Jones (cmsj) wrote :

Lee: I'm thinking of two specific things:

 * In the titlebar where we show the name of the grouping on the left I'd like it to be more obvious, so probably a different colour, but this needs to be done with different themes in mind (i.e. we shouldn't just hardcode colours, but take sensible items from the current gtk theme, like we do when choosing colours for the titlebars themselves). I think this will mean slightly repacking the titlebar so that it contains two HBoxes, one for the group name and one for the terminal title, because otherwise all we have to set colours for is the gtk.Label with the group name, and I'm pretty sure you can't set the background colour on those (in that a label is just text, so effectively has no background).
* the window which is opened to enter a name for a new grouping was pretty quickly hacked up and probably has a bunch of problems (not least of which, it can be resized in both directions even though it should only be possible to make it wider).

On the second point, someone suggested http://www.python-forum.de/viewtopic.php?p=34394 is a good thing to use for simple input windows like that, but it seems kinda long and complicated just for this.

If people have other suggestions for how to improve the UI, I'm happy to hear them. I did experiment with using a dropdown instead of the gtk.Label so you could change the group more easily, but it makes the titlebar pretty big and it's more complex than putting it in the context menu.

Revision history for this message
Markus Korn (thekorn) wrote :

My idea was to have some kind of multi toggle button in the title bar which allows the user to loop over all existing groups, create new groups or group all terminals in one action.
I started implementing it in lp:~thekorn/terminator/multi.toggle.group in terminatorlib/grouptoggle.py
Running
   python terminatorlib/grouptoggle.py
shows an example. Until now I had no time to integrate this into terminator, but will try soon.

Usage of this multi-toggle:
  * left clicking on label loops over all existing groups
  * if 'None' is the only group, open dialog to create a new one
  * right-clicking on label shows a menu which allows to either
      - create a new group or
      - or toggle between group all/ group none mode

What do you think about such a solution?
Suggestions etc. as always most welcome ;)

Markus

Revision history for this message
Markus Korn (thekorn) wrote :

the recent version in my branch has now this multi switcher in the titlebar, it works well enough for a first demonstration.
One question is still unsolved: how should this work with hidden titlebar.

Markus

Changed in terminator:
assignee: thekorn → nobody
status: Fix Committed → In Progress
Revision history for this message
Markus Korn (thekorn) wrote :

changed status and removed me as assignee

Revision history for this message
Chris Jones (cmsj) wrote :

Markus: It's interesting, although it doesn't seem very discoverable - how will people know to click there?

Revision history for this message
Markus Korn (thekorn) wrote :

Chris, I think you are right, this way it is not very discoverable. But on the other hand IMHO it is a very advanced feature and if it is well documented it should be fine.
In my opinion clicking through menus to group terminals slows everything down too much.

Revision history for this message
Chris Jones (cmsj) wrote :

Hi

Markus Korn wrote:
> In my opinion clicking through menus to group terminals slows everything down too much.

I don't disagree with that, it is quite cumbersome.

My original idea was to have the gtk.Label actually be a dropdown, but
it ends up too big. Perhaps we should re-invent that particular wheel
and put a relief border around the group name so it looks like it's
clickable, and just attach a popup menu to it when people click on it?

Cheers,
--
Chris Jones
  <email address hidden>
   www.canonical.com

Revision history for this message
Volans (volans) wrote :

What version of this feature is included in the 0.12 version of Terminator (revision 628)?

Because if I group some terminals and after press enter all the terminals selected execute the command but if I wrote something to one terminal all is repeated N times where N is the number of terminals selected.

So if I select 3 terminals and type "c", in one terminal I see "ccc" and in the others nothing, pressing enter the first terminal execute the "ccc" command (obviously not found) while the others just doing the equivalent of press enter without a command.

In the terminal where I have started Terminator when pressing a keybord key while in Group mode doesn't appear any message and the same happens if terminator is started with the -d option.

Moreover I have to group the terminals from the menu, the Ctrl+Alt+m doesn't work for me.

This is a very useful feature, thanks a lot! :)

OS: Ubuntu 8.10 Intrepid Ibex 64bit
Kernel: 2.6.27-9-generic
Terminator version: 0.12 (bzr revision 628)

Revision history for this message
Chris Jones (cmsj) wrote :

Volans: The current implementation in trunk is a rewrite of Marcus' original. It no longer has the ctrl-alt-m option.

I'm not sure exactly what you mean about the input going to one terminal only.
Could you provide an exact sequence of steps to reproduce the issue? It seems to work fine for me.

Revision history for this message
Volans (volans) wrote :

Sure:
- open terminator
- split terminal with ctrl+o or ctrl+e
- mouse right click to show the menu, select Group -> Group All (for example)
- write something to the focused terminal

What happen to me:
- in the focused terminal every pressed key appers N times where N is the number of the grouped terminals, 2 in this case. So if I press "c" I see "cc".
- in the other grouped terminals nothing happens

It seems that the input is sent the right number of times but all to the same terminal instead of to all the grouped one.

See the attached image.

Revision history for this message
Chris Jones (cmsj) wrote :

Volans: could you file that as a new bug? This is better suited to being a tracking wishlist bug - specific problems should be bugs in their own right I think.

Chris Jones (cmsj)
Changed in terminator:
assignee: nobody → cmsj
milestone: 1.0-beta → 0.12
Revision history for this message
Volans (volans) wrote :

Ok, done (see bug #314233 )

For the whishlist part of this bug I think that when the "Group all" function is used a "Ungroup all" function can be very useful.

Possible evolutions of the groups can also be:
- click on the name of the group at the left of the title bar show the list of group to change the group of the terminal or ungroup it (set to none).
- right-click on the name of the group at the left of the title bar show the Group menu (in alternative or together with the previous one)

Revision history for this message
Chris Jones (cmsj) wrote :

Volans: Thanks. I've just added an "Ungroup all" menu item that will appear if there are any terminal groups active, and will drop all terminal groups completely.

I'm marking this Fix Committed since the feature is in place, and will look at the other bug separately.

Changed in terminator:
status: In Progress → Fix Committed
Revision history for this message
Chris Jones (cmsj) wrote :

Released in 0.12

Changed in terminator:
status: Fix Committed → Fix Released
Revision history for this message
Pawel (cryptonix) wrote :

Just installed 0.12, works perfectly. Thanks!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.