Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ability to move tabs between Termonad windows (manage multiple windows in same Termonad process) #6

Open
cdepillabout opened this issue Aug 26, 2018 · 1 comment
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@cdepillabout
Copy link
Owner

It would be nice to be able to move tabs between two different termonad windows.

Currently, if you open up two different copies of Termonad, they are treated as two completely separate applications. They share nothing.

The design of Termonad should be changed so that multiple Termonad windows are handled by the same termonad process.

Implementing this will require at least the following steps (if not more):

  • Change the TMState' data type to have multiple ApplicationWindows (and probably split off this type into a TMWindow type that contains the ApplicationWindow and TMNotebook).
  • Change the call to appNew to be something like appNew (Just "some.app.name") .... some.app.name should be something like haskell.termonad, or com.github.cdepillabout.termonad or something like that. Note that it needs a . in it.
  • When you try to start Termonad and it is already open, you need to change the logic to instead create a new TMWindow instead. I'm not sure exactly how to go about this.
  • Add the ability to drag and drop terminals between Termonad windows. I think the gtk notebook has functions related to drag-and-drop.
  • Finally, make sure that the logic for closing windows using your window manager still works. (You should still get a pop-up asking you if you are sure you want to close the terminal.)
@cdepillabout
Copy link
Owner Author

cdepillabout commented Jan 26, 2024

Over the last couple of months, I did some refactoring with the idea of working towards this.

In particular, I split out the following modules:

  • Termonad.App: responsible for managing things that have to do with the entire App. In particular, this would handle things like copy&paste, showing the "About" dialog, etc. None of these things really have to do with a single Termonad window, but global to the Termonad application.
  • Termonad.Window: responsible for managing individual Termonad windows, including the GTK Notebook, which contains a set of terminals. (Note that the functionality for managing multiple windows is not actually implemented yet, so for now Termonad will always only have a single window.)
  • Termonad.Term: responsible for managing individual Termonad terminals.
  • Termonad.Types: data types that are used in all of the above modules. Also contains various functions.

A couple things that still need to be figured out and implemented:

  • There are still a lot of functions in the code base that are not located in the logically "correct" module, and will need additional refactoring. (For instance, functions in Termonad.App that modify things about individual windows.)
  • There are a bunch of places in the code where child modules reach in and modify data types from parent modules. For instance, the Termonad.Term.createTerm function defines callbacks with a Terminal that modify the GTK Notebook owned by Termonad.Window. This happens basically at every layer of the stack (Termonad.App / Termonad.Window / Termonad.Term).
  • There are a bunch of places in the code where terminals need to figure out what window they are owned by. There currently isn't a good way to do this. (And this may be a symptom of the previous point)
  • The actual functionality for creating new windows needs to be implemented.
  • The actual functionality for moving terminals between windows needs to be implemented.

I'm going to take a break from this for a while, but I plan on coming back to this at some point. I have a little bit of work on this in the multi-wins branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant