layout is hard coded

Bug #87720 reported by Chris Jones
172
This bug affects 18 people
Affects Status Importance Assigned to Milestone
Terminator
Fix Released
Wishlist
Rahmadani bayu aji

Bug Description

At present four terminals are opened at fixed sizes. This should be specified by a config file, maybe XML,

Chris Jones (cmsj)
Changed in terminator:
assignee: nobody → cmsj
importance: Undecided → Wishlist
status: Unconfirmed → Confirmed
Chris Jones (cmsj)
Changed in terminator:
status: Confirmed → Triaged
Revision history for this message
Chris Jones (cmsj) wrote :

The default behaviour is now for a single terminal at "normal" size. This is partly because it's much easier than making dangerous assumptions about sizes, but mainly so it will encourage me to produce a config file scheme for custom setups.

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

I'm unmilestoning this feature because I'd like to get something into Hardy, so I'm going to start driving a good release.

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

trunk now has support for a basic ~/.terminatorrc to override self.defaults and provide options not in gnome-terminal gconf profiles. Additionally it is useful for people without gconf.

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

http://www.voidspace.org.uk/python/configobj.html#introduction looks like an interesting option for writing config files rather than depending on XML libraries.

Revision history for this message
holst (henrik-holst-matmech) wrote :

Please, stick to one way of doing things.

Terminator is a "Gnome application" right? So save applications like gnome does.

Having a mix of things is just terrible from a user perspective. I already got WAY to many "dot files" in my home directory. It is starting to feel like my Windows home directory, where I knew nothing about the files in my home dir.

But I love the idea to support custom keybindings etc. with gconf.

Revision history for this message
Thomas Hurst (tom.hurst) wrote :

Nope, Terminator can use some Gnome features, and uses the Gnome terminal widget, but it's not a Gnome application; gconf support is optional, and only really there so we can use gnome-terminal settings to configure vte.

configobj: 1,100 lines of Python which depends only on Python, makes a nice human readable ini-style dotfile in ~/.config/terminator/config (the recommended freedesktop.org standard). Editable using vim and in Terminator.

gconf: 20,000 lines of C, plus a few hundred thousand lines in dependencies which includes a lot of Gnome (most of which Terminator itself doesn't need), and spawns a service, all so we can have ~/.gconf/apps/terminator/%conf.xml, and probably subdirectories in there with their own XML. Editable using gconf-editor and in Terminator.

I think I know which I prefer :)

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

It's also worth noting that since the point of this bug is to allow for arbitrary configurations of terminals, gconf is actually a very poor choice.
It may well be true that applications such as GNOME Terminal store profile data in gconf, however, they should not. It is a violation of gconf's design.

In the GConf world, everything is supposed to be a pre-ordained key - this is why there are schema files. You may have noticed that there is no way to delete a key, all you can do is unset it (which effectively means "revert to default schema value"). If we use gconf to contain our profile settings as well, we will be increasing this abuse of gconf.

As we get full profile support and some GUI options for editing them, the gconf config support in Terminator will become less and less important, I suspect.

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

Setting this as In Progress since we do now have a much more flexible config parser which allows us to save layouts. We don't actually save or load them yet, but the groundwork is in place thanks to Thomas Hurst.

Changed in terminator:
status: Triaged → In Progress
Revision history for this message
Thomas Hurst (tom.hurst) wrote :

The config parser doesn't handle saving yet, but it does lay the groundwork for being able to handle far more structured config files, and will eventually be able to save them.

We decided against configobj, mainly because the way it adds structure is fugly; it nest sections like this:

  [section]
  [[subsection]]
  [[[subsubsection]]]

You can see this quickly getting ridiculous. It also means a lot of our existing configs will break, since it'll parse something like "background_color = #000" as an empty value followed by a comment "000".

The new parser copes with this, and a few other special cases, can recover gracefully from most errors, and does nesting in a much more pleasing manner:

  [section]
    [subsection]
      [subsubsection]

i.e. it uses indenting, just like Python. This isn't yet enabled in trunk, but the code to add it is already there, and quite modest Our problem now is working out exactly *how* we should make use of this.

Revision history for this message
Lucas Nussbaum (lucas) wrote : Re: [Bug 87720] Re: config is hard coded

Hi,

By "new parser", do you mean something written specifically for
terminator?
--
| Lucas Nussbaum
| <email address hidden> http://www.lucas-nussbaum.net/ |
| jabber: <email address hidden> GPG: 1024D/023B3F4F |

Revision history for this message
Chris Jones (cmsj) wrote : Re: config is hard coded

Lucas: Yes, Thomas looked at the various existing config parsers and they didn't really lend themselves to the kind of information we need to express (or they did express it fine, but not in a form that a human can easily parse and write)

Revision history for this message
Lucas Nussbaum (lucas) wrote : Re: [Bug 87720] Re: config is hard coded

Ouch.

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote : Re: config is hard coded

For what it's worth, I took a look at the attached branch from Chris Oattes (cjo20) for fun and to learn a bit of python, and did some work to apply it to the current trunk. It's still done the same way as cjo20 had done it, a separate layout file, but I moved it to ~/.terminator/layout. It's on my bazaar branch (lp:~mathieu-tl/terminator/devel)

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

I've recently landed a huge refactoring project on trunk, one outcome of which is that despite our earlier objections to it, the config file format we use will be switching to configobj in the next release (0.90).
After that release is done, my primary focus will be savable layouts.

summary: - config is hard coded
+ layout is hard coded
Revision history for this message
Chris Jones (cmsj) wrote :

It's by no means perfect yet, but trunk now has some ability to save and restore layouts.

Changed in terminator:
status: In Progress → Fix Committed
Revision history for this message
David Rosenstrauch (darose) wrote :

Cool! Thanks much for the hard work on this feature!

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

So in what version of terminator will I be able to change my default window sizes? Currently I am running 0.95 on Arch. Thanks.

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

Stephen: 0.95 should be able to do that by means of the layout configuration. Window objects can have 'position' and 'size' attributes, e.g.

[layouts]
  [[default]]
    [[[window0]]]
      type = Window
      parent = ""
      position = 0:0
      size = 800, 600
    [[[child1]]]
      type = Terminal
      parent = window0

I'm not convinced this will remain as the final syntax for position/size, the difference between : and , as separators seems rather stupid as a decision, in retrospect.

Revision history for this message
Third Replicator (thirdreplicator) wrote :

Hi,
  I instaleld 0.95 and copied and pasted this configuration into ~/.terminatorrc, then ran "terminator" at the command line, but I didn't see a sub window the size was not 800x600. Am I missing something?
  David :)

Revision history for this message
ViktorNagy (viktor-nagy) wrote :

I'm running 0.95 from ubuntu lucid

I might misunderstand the terminus, but I've tried to create a layout that shows 3 terminals where the window is once split up vertically, and once horizontally.

Using hand-coding + the prefeditor I've ended up with this:

[global_config]
[keybindings]
[profiles]
  [[default]]
  [[Command]]
    visible_bell = True
    urgent_bell = True
    audible_bell = True
    exit_action = hold
[layouts]
  [[default]]
    [[[child1]]]
      type = Terminal
      parent = window0
    [[[window0]]]
      type = Window
      parent = ""
  [[OpenERP]]
    [[[child1]]]
      type = Terminal
      parent = window0
      profile = default
      command = mc
    [[[child2]]]
      type = Terminal
      parent = window0
      profile = Comnmand
      command = ""
    [[[window0]]]
      type = Window
      parent = ""
[plugins]

but running
$ terminator -l OpenERP
incorrect number of children for Window: {'profile': 'default', 'type': 'Window', 'children': {'child1': {'profile': 'default', 'parent': 'window0', 'command': 'mc', 'position': '', 'type': 'Terminal', 'children': {}, 'size': ['-1', '-1']}, 'child2': {'profile': 'Comnmand', 'parent': 'window0', 'command': '', 'position': '', 'type': 'Terminal', 'children': {}, 'size': ['-1', '-1']}}, 'size': ['-1', '-1']}

and only a single frame terminator opens

the debug option did not help me out unfortunately

Revision history for this message
ViktorNagy (viktor-nagy) wrote :

I went on following the code, and ended up with a working and a "probably good, but not working" layout.

the following would create two tabs, one of them split up on 3 terminal, the other being a single terminal. this does not work

[global_config]
[keybindings]
[profiles]
  [[default]]
  [[Command]]
    visible_bell = True
    urgent_bell = True
    audible_bell = True
    exit_action = hold
[layouts]
  [[default]]
    [[[child1]]]
      type = Terminal
      parent = window0
    [[[window0]]]
      type = Window
      parent = ""
  [[OpenERP]]
    [[[window0]]]
      type = Window
      parent = ""
    [[[tabs]]]
      type = Notebook
      parent = window0
    [[[main]]]
      type = HPaned
      parent = tabs
      command = ""
      profile = default
    [[[erp]]]
      type = VPaned
      parent = main
    [[[command]]]
      type = Terminal
      parent = main
      profile = default
      command = mc
    [[[web]]]
      type = Terminal
      parent = erp
      profile = Command
      command = ""
    [[[server]]]
      type = Terminal
      parent = erp
      command = ""
      profile = Command
    [[[extra]]]
      type = Terminal
      parent = tabs
      profile = default
      command = ""

on the other hand, if I take out the Notebook part and the extra terminal, then this works (showing only the layouts part)

[layouts]
  [[default]]
    [[[child1]]]
      type = Terminal
      parent = window0
    [[[window0]]]
      type = Window
      parent = ""
  [[OpenERP]]
    [[[window0]]]
      type = Window
      parent = ""
    [[[main]]]
      type = HPaned
      parent = window0
      command = ""
      profile = default
    [[[erp]]]
      type = VPaned
      parent = main
    [[[command]]]
      type = Terminal
      parent = main
      profile = default
      command = mc
    [[[web]]]
      type = Terminal
      parent = erp
      profile = Command
      command = ""
    [[[server]]]
      type = Terminal
      parent = erp
      command = ""
      profile = Command

do you see any errors in my config, or is this a bug?

Revision history for this message
Mathew Hennessy (ubuntu-unixslave) wrote :

Has this fix/version been pushed to Ubuntu yet?

Revision history for this message
Jagannathdas Rath (jrathindia) wrote :

Use this for 4 screen layout

  [[OpenERP]]
        [[[window0]]]
              type = Window
              parent = ""
            [[[main]]]
              type = HPaned
              parent = window0
              profile = default
            [[[erp]]]
              type = VPaned
              parent = main
            [[[erp2]]]
              type = VPaned
              parent = main
            [[[command]]]
              type = Terminal
              parent = erp2
              profile = default
            [[[command2]]]
              type = Terminal
              parent = erp2
            [[[web]]]
              type = Terminal
              parent = erp
              profile = default
            [[[server]]]
              type = Terminal
              parent = erp
              profile = default

Revision history for this message
_git (hdt-q) wrote :

Hello, I am using Terminator 0.96, and I am able to save layouts. The problem for me is that I cannot add "cd /to/my/directory" as custom command because after executing it that terminal exits. Furthermore, if I choose the option "Hold the terminal open" in Profiles->Command->"When command exits:" the terminal keeps opened, but I lose the prompt.

Changed in terminator:
assignee: Chris Jones (cmsj) → 991 (asstaroid)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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