Migrate most of the Terminal code to Rust #23325

Closed
opened 2026-01-31 08:38:54 +00:00 by claunia · 2 comments
Owner

Originally created by @ghost on GitHub (Jun 2, 2025).

Description of the new feature

Windows Terminal has had several major changes of code in the past, such as AtlasEngine.

What do you think of rewriting most of the Windows Terminal code in Rust language, keeping the C# only for the WinUI interface, since the Rust does not support GUI?

It can be something progressive, in a different branch, and only after testing, being transferred to the "main" branch.

Conhost can be kept in old language C/C ++, with minimal changes, as is currently happening for compatibility reasons.

Team members such as @DHowett, @lhecker and @zadjii-msft, seem to be familiar with Rust, due to their contributions in other repositories such as microsoft/edit and microsoft/sudo.

Motivation

All advantages of Rust language, such as lower memory use, higher speed, safe memory use, etc.

Unfortunately I only know JavaScript, otherwise I could make contributions myself.

Originally created by @ghost on GitHub (Jun 2, 2025). ### Description of the new feature Windows Terminal has had several major changes of code in the past, such as AtlasEngine. What do you think of rewriting most of the Windows Terminal code in Rust language, keeping the C# only for the WinUI interface, since the Rust does not support GUI? It can be something progressive, in a different branch, and only after testing, being transferred to the "main" branch. Conhost can be kept in old language C/C ++, with minimal changes, as is currently happening for compatibility reasons. Team members such as @DHowett, @lhecker and @zadjii-msft, seem to be familiar with Rust, due to their contributions in other repositories such as [microsoft/edit](https://github.com/microsoft/edit) and [microsoft/sudo](https://github.com/microsoft/sudo). ### Motivation All advantages of Rust language, such as lower memory use, higher speed, safe memory use, etc. Unfortunately I only know JavaScript, otherwise I could make contributions myself.
claunia added the Issue-FeatureNeeds-TriageNeeds-Tag-Fix labels 2026-01-31 08:38:54 +00:00
Author
Owner

@lhecker commented on GitHub (Jun 2, 2025):

All advantages of Rust language, such as lower memory use, higher speed, safe memory use, etc.

FWIW I can assure you as someone who really likes Rust that the blazing fast Rust projects are often anything but. It is very unlikely that a rewrite will achieve further memory or speed improvements that are difficult to achieve in C++. The biggest benefit in Rust for us lies in its genuinely good support for slices, which we need a lot throughout the project.

Conhost can be kept in old language C/C ++, with minimal changes, as is currently happening for compatibility reasons.

IMO conhost may actually the one project that may benefit from this the most (at least initially), because it implements the PTY.

That said, I don't think we can do this due to lack of funding for the project. There's also the question whether this is worth doing. The project is in the magnitude of around 200k LOC and it would take around half a year to port it to Rust and C#, with no new features added to the product. I don't think a partial conversion of the project is worth it, because maintaining 3 languages is strictly worse than maintain 2. We can consider the thought in earnest for new libraries though...

@lhecker commented on GitHub (Jun 2, 2025): > All advantages of Rust language, such as lower memory use, higher speed, safe memory use, etc. FWIW I can assure you as someone who really likes Rust that the blazing fast Rust projects are often anything but. It is very unlikely that a rewrite will achieve further memory or speed improvements that are difficult to achieve in C++. The biggest benefit in Rust for us lies in its genuinely good support for slices, which we need *a lot* throughout the project. > Conhost can be kept in old language C/C ++, with minimal changes, as is currently happening for compatibility reasons. IMO conhost may actually the one project that may benefit from this the most (at least initially), because it implements the PTY. That said, I don't think we can do this due to lack of funding for the project. There's also the question whether this is worth doing. The project is in the magnitude of around 200k LOC and it would take around half a year to port it to Rust and C#, with no new features added to the product. I don't think a partial conversion of the project is worth it, because maintaining 3 languages is strictly worse than maintain 2. We can consider the thought in earnest for new libraries though...
Author
Owner

@DHowett commented on GitHub (Jun 2, 2025):

It was nice of you to respond, but this person seems to have been a mirage.

They also seem to have thought that we used C# for our UI code.

Alas.

@DHowett commented on GitHub (Jun 2, 2025): It was nice of you to respond, but this person seems to have been a mirage. They also seem to have thought that we used C# for our UI code. Alas.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#23325