Sixdsn / terra-terminal

Terra is a GTK+3.0 based terminal emulator with useful user interface, it also supports multiple terminals with splitting screen horizontally or vertically. New features have been added since September 2013. It's a pretty new and experimental project, if you want to contribute just checkout and try.
GNU General Public License v3.0
7 stars 3 forks source link

Do not keep information about closed terminal windows #107

Closed SchnWalter closed 9 years ago

SchnWalter commented 9 years ago

Looks like some information is kept when a terminal window is closed. But from what I can tell this information is no longer used.

Sixdsn commented 9 years ago

Well actually it's used in TerminalWin::save_conf to delete previous layouts saved in the main.yaml to avoid to keep unused layouts that might have been saved before and are no longer used.

SchnWalter commented 9 years ago

Looks like I missed that part.

Question: How are you actually using this "save" functionality?

Is it a way to store information about the current windows, tabs and tab-layout for next time you open up the terminal? Wouldn't it be better to have a sort of "workspaces" that you can switch between them? Or to actually remember the layout upon exit, just like you have in browsers?

SchnWalter commented 9 years ago

Looks like the tabs and tabs layout configuration is also not properly cleaned when a window is closed... But I believe that the ~/.config/terra/main.yaml file should be updated only when the "Save Configuration" button is clicked and not when someone closes a window.

Here is what I am proposing:

  1. Store all information about the window position, tabs and tabs layout in dictionary tree inside each TerminalWin() instance.
  2. Update the ConfigHandler.save() to use window configuration from the active terminal windows and just discard what is already in the config file related to layout (maybe also use a different file for these)
  3. Update all classes to use the new structured window, tabs and tabs layout configuration.
  4. Save all this layout information only when the "Save Configuration" is clicked. And maybe rename the button to "Save Session"... Or maybe replace this button with a "Remember session upon exit" option in the General Preferences tab.
Sixdsn commented 9 years ago

Actually this is already what it does. each TerminalWin has it's own properties and the TerminalWin::save_conf saves its properties in main.yaml It's only saved when the button Save Configuration is activated I agree with the option Remember session upon exit wich should have the same behaviour as in browsers. But to have a separate button to save the configuration is usefull beceaus you can temporarly modify your layout for a specific job, and if you don't save it, next time you will open terra it will load the layout without your temporary modifications. I will create the issue Remember Session

SchnWalter commented 9 years ago

I'll do a cleanup for #108.

And I'll include this change in the branch of that ticket... and I'll keep the commits as small as possible so that they can be easily reviewed.

Sixdsn commented 9 years ago

Well i was already working on this :) That's why i assigned it to myself, i just need to finished the .ui file modification.