extraterm icon indicating copy to clipboard operation
extraterm copied to clipboard

Replace Electron UI with Qt

Open sedwards2009 opened this issue 3 years ago • 14 comments

Here are some technical details about how this transition is going to work.

The core language used will remain TypeScript/JavaScript running on the fast V8 engine via nodejs. This is good news and means that large chunks of the Electron based Extraterm version can be moved straight over and to the Qt version. I'll be using NodeGui as the bindings connecting V8 to Qt's libraries. Qt is a very mature set of libraries, but it is very C++ oriented which makes connecting to other languages difficult. NodeGui itself though isn't mature and hasn't reached a stable version 1.0 yet. Normally this would be a showstopper but I have an ace up my sleave as I've worked with Qt in the past and also have a quite a lot of experience with connecting Qt related classes to other languages like Python and JavaScript. To NodeGui's credit, it is a fairly simple binding of C++ to V8 which makes some smart trade offs regarding how to connect Qt to JS while avoiding the tarpit of trying to replicate all of Qt's C++ API. NodeGui is quite easy to get hacking on and I've already submitted a number of PRs to NodeGui to expand it.

Here are some random thoughts about certain features and what will happen to them. Many are high priority, some will be put in the freezer 🧊 for later, and some will be axed 🪓.

  • Basic features like tabs, the extension system, different session types, frames, command palette, settings pages, hyperlinks, copy/paste, etc are top priority.
  • 🧊 (color) emoji
  • 🧊 Ligature - This might be easy to add back in.
  • 🧊 Autocomplete extension
  • 🧊 'Find' extension
  • 🧊 Terminal title extension
  • 🧊🧊 Non-native and compact window title bar.
  • 🧊🧊 Flat modern theme - Qt has a number of native looking themes for each platform and I'll be using them first. Once the basic functionality is in place I can go shopping for a suitable modern looking theme and/or reimplement the theme used in the Electron version of Extraterm.
  • 🧊🧊 Inline image viewing and downloads.
  • 🧊🧊 Cursor mode and direct editing - The component I was using to do this is heavily web based and thus won't be coming to the Qt version. Basic direct editing and cursor features will have to be re-implemented. I'll be able to do a high performance version though which better matches the needs to Extraterm though compared to the Electron approach.
  • 🪓 Splits and panes - Once it is possible to move tabs in and out of windows, I expect that using desktop or operating system's window management to satisfy the need behind splits and panes.

I'm open to feedback about this list and its order.

sedwards2009 avatar Jun 26 '21 17:06 sedwards2009

One feature I would like to throw into the list of "eventually's" is some sort of enhanced file management, to see the local files and remote files to down/upload to the remote pwd. I am definitely interested to see what you have planned overall with the new UI. I just hope it feels and acts as "modern" as extraterm does. I made an addon for a 3d application called Houdini using Qt and I felt it always felt sort of... rigid? hard to explain, I guess.

Searcher

image

It could be, though, because it was Qt with Python, but I guess Qt is Qt when it comes to the actual interface objects and such. Either way, I am sure it will be good.

MostHated avatar Jun 28 '21 03:06 MostHated

regarding splits and panes I expect people may want to use them with toggle window hotkey, in such case relying on system window manager wouldn't work

zakius avatar Apr 27 '22 08:04 zakius

He @sedwards2009 I've been watching this QT work eagerly, is it at the stage now where you would like bug reports of things I notice that don't work right? (For example, I've noticed problems with using "cmd"/super as a keyboard shortcut modifier on Linux)

Edit: the fix for it appears easy enough, so I opened a PR https://github.com/sedwards2009/extraterm/pull/379

ashb avatar Jun 30 '22 13:06 ashb

@ashb Yes, for a lot of the basics which have been in there a while, it is a good time for bug reports.

sedwards2009 avatar Jun 30 '22 20:06 sedwards2009

I installed the QT version last night on a new machine, and I've noticed it' doesn't like starting after a crash, every time it crashes, the only way to make it start again is to completely delete the config folder even returning a previous config won't make the app start again, it has to be removed.

creativeworkssystems avatar Aug 09 '22 22:08 creativeworkssystems

@creativeworkssystems Which OS are you using?

sedwards2009 avatar Aug 10 '22 09:08 sedwards2009

Windows 11, latests updates installed. ETQT v 65.0

sidenote : hate not having accoutn switching on github, I end up commenting with a work account half the time :P

creativeworkssystems avatar Aug 10 '22 18:08 creativeworkssystems

It's a shame that split panes are going to be axed (is this definite?). I looked at this project because it was meant to be my iterm replacement on Ubuntu after wezterm was too slow (needs hardware acceleration), but the lack of splits is a deal breaker for me :(

mzjp2 avatar Aug 12 '22 18:08 mzjp2

@mzjp2 Split panes aren't totally out of the question, but they are somewhat low on the list compared to better support for multiple windows and moving tabs in and out of windows. I'm open to "cheap" ways of adding splits and panes back in. Something like https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System might be a solution, and it might also help handle the cases of moving tab in/out of windows (which is high on the TODO list).

sedwards2009 avatar Aug 12 '22 21:08 sedwards2009

FYI, for the next release I'm working on applying Qt Advanced Docking System to Extraterm. It will mean that having an option for windows without the native title bar won't be possible any more though. But that is an acceptable trade off.

sedwards2009 avatar Mar 13 '23 18:03 sedwards2009

I dunno, I hate the stock titlebar, and I like using this because it doesn't have it.

MostHated avatar Mar 13 '23 22:03 MostHated

@MostHated I'm pretty deep into the Qt Advanced Docking System related work. I did notice that on Linux at least there is some support for a custom window title bar. As long as you're on Linux then there is some hope.

sedwards2009 avatar May 04 '23 11:05 sedwards2009

I am indeed, pop_os. At the same time, though, I am just one fella. I would say it is really worth it for one person, if it is a huge undertaking.

MostHated avatar May 04 '23 16:05 MostHated

@MostHated FYI, it has taken a while to get to, but I'm working on the custom window decorations. It should work on Windows too. On Linux with Wayland at least you're kind of encouraged to do your own window decorations because Wayland doesn't really support the concept of "native" or server side decorations.

sedwards2009 avatar Oct 22 '23 10:10 sedwards2009