Make deps of several C++ header libraries to improve terminal #283
Replies: 22 comments 7 replies
-
Many thanks @WSLUser . I'll definitely have a look at it. p.s.: fmtlib (and range-v3) I am already using. boost I'll definitely not use, but I'll look at the rest tomorrow. thanks :) |
Beta Was this translation helpful? Give feedback.
-
Yeah they really didn't want to import anything of boost but there were certain things within it that proved too helpful for some things in the project. They have kept the amount of boost code down to as safe a minimum as they could possibly do. Undoubtely it could be reduced further, but it would take someone with more experience with boost and intimately familiar with the project to further reduce unnecessary boost code. |
Beta Was this translation helpful? Give feedback.
-
The list of C++-level helper dependencies I am currently having are:
all but yamlcpp are even header-only. Iff i see fit, I am not against adding a other libs, since it's all auto-fetched). Checklist of WT OSS deps
|
Beta Was this translation helpful? Give feedback.
-
the xorgs_apps_rgb is just a reference showing they've adopted the rgb table from Xorg to better support colors for OSC. They try to provide all color support to ensure even legacy apps can benefit. They use interval_tree for supporting the OSC 8 hyperlink sequence, mostly to ensure Windows Terminal can automatically detect and allow clickable URLs in the terminal window. Dynamic_bitset has helped improve things in noticeable ways. I'd check the code for that project out and if there's room for improvement, I'm sure they'd make the necessary updates. On top of this, libpopcnt is designed to work automatically with it if defined. Chromium Overall, you might best look at https://github.com/microsoft/terminal/tree/main/src/til/ut_til, which are libraries created by the WT devs to make things easier for implementing or improving code health in various ways including especially performance. I believe most of these libraries utilize some if not all of these OSS projects so all the hard to read for users code can be hidden and not need to be reviewed once understood what it's doing. In essense, those libraries make code easier to read throughout the rest of the project. Not sure if you'd be able to adopt them as-is or if you even need to, but should help with understanding the project a bit more. |
Beta Was this translation helpful? Give feedback.
-
That is nice. I was actually looking into the xterm source code manually for that.
OSC-8 does not need that, but detecting URLs that are not embedded by OSC-8 do.
That's why i created the above table, so I can get an overview of what might be beneficial for Contour, too. I think I will have a look over the above deps and will consider each of them individually, given some time and space (of course) :-)
Being short before my next release, I am currently especially focusing on code health (bug fixes / API cleanups for better maintainability / modularity). That will surely be helpful. Many thanks. |
Beta Was this translation helpful? Give feedback.
-
Replace Catch2 to https://github.com/boost-ext/ut (works with std 17)? |
Beta Was this translation helpful? Give feedback.
-
Yeah I'm not so sure about CLI11 here. It's a good argument parser that's used for the terminal application (WT) to do things like create profiles, tabs, panes, etc. but maybe not necessary for this terminal. I had suggested they use TOML but currently everything is configured using json. TOML would be a better configuration manager. I hadn't been aware of that particular project. That UT project looks pretty awesome. I do wonder, MS Terminal supports some stuff from C++20 as they use gsl (which switched to C++20) (required updating use of span) and FMT (which will be part of the native C++ 20 library). But that project is still mostly C++17. Unfortunately looks like UT doesn't work for MSVC kris-jusiak/ut@bc87813 so I hope the Windows builds for this project use gcc still. |
Beta Was this translation helpful? Give feedback.
-
Well, I need to be able to compile on:
At least that's what we're currently having in the CI (considering ARM64 since today, by accident) @WSLUser I know you're most likely more active on Windows (not sure how often you touch linux natively), bare in mind, my Windows port is like a second step brother currently because I am still lagging a proper DirectWrite implementation of the text shaping / font rasterization API (see here). I'm having a WIP, but that one is a pure research battlefield for getting to know Windows APIs. Freetype/Fontconfig/Harfbuzz does indeed compile and somehow on Windows, But I cannot do font fallback without talking to DirectWrite, so I'm stuck until the earlier mentioned interface is properly implemented for windows. (just FYI) ^^ |
Beta Was this translation helpful? Give feedback.
-
In that case, I'd highly suggest you unashamedly steal the DirectWrite implementation Windows Terminal uses. It's gone through a number of optimizations and support for various things (There's even now a PR to get Bold finally supported there). You can even import shader files for your background if you wanted (you'll need to link to your own settings manager of course) but font fallback is included among other things. If you look through some of the PRs they've done, they reference various MS docs that describe using the APIs for DirectWrite. |
Beta Was this translation helpful? Give feedback.
-
I touch Linux natively but in other areas. I'm by no means a C++ or terminal expert. But I do try to pick up on things to increase my knowledge. |
Beta Was this translation helpful? Give feedback.
-
MS Terminal also uses it. 😃 |
Beta Was this translation helpful? Give feedback.
-
Yes I know. If you started using it (haven't checked), then my statement can be ignored. |
Beta Was this translation helpful? Give feedback.
-
Actually I am using my own rolled CLI API, as the requirements I have set on how the CLI syntax should look like are not classical POSIX, but more like how iproute2 package binaries are working: While I usually definitely prefer the POSIX style syntax here in that case I prefer the human phrase style one. (I think I've added some POSIX compatibility to it though, which is simply not printed in the help output as I didn't encourage that style, I'm open though). |
Beta Was this translation helpful? Give feedback.
-
I'd honestly prefer you keep POSIX style syntax. Truth is everybody is used to it, especially in non-Windows world. But even Windows has some POSIXisms to it now (purposely so due to WSL). That said, you can always offer the human phrase style as an alternative in addition to the POSIX style. Maybe people will adopt that instead and request other terminals do the same, you never know. |
Beta Was this translation helpful? Give feedback.
-
Yeah, it's cool! |
Beta Was this translation helpful? Give feedback.
-
Will do. And then link it here |
Beta Was this translation helpful? Give feedback.
-
Use https://github.com/gulrak/filesystem instead of |
Beta Was this translation helpful? Give feedback.
-
EDIT: 11.x.x supports std::filesystem so all should be good |
Beta Was this translation helpful? Give feedback.
-
? |
Beta Was this translation helpful? Give feedback.
-
https://github.com/BowenFu/matchit.cpp is awesome! |
Beta Was this translation helpful? Give feedback.
-
https://github.com/DuffsDevice/tiny-utf8 is a nice drop-in replacement for |
Beta Was this translation helpful? Give feedback.
-
Windows Terminal uses these C++ libraries: https://github.com/microsoft/terminal/tree/main/oss for a few things that include type-safety, thread-safety, safer math, performance, and easier implementation of some functionalities. Since this is a C++ terminal project, I thought I'd recommend these to improve things here. These libraries work on all platforms (Linux, Windows, MacOS).
Beta Was this translation helpful? Give feedback.
All reactions