Can we get rid of the AdaptDefaults interface? #16579

Open
opened 2026-01-31 05:16:20 +00:00 by claunia · 0 comments
Owner

Originally created by @j4james on GitHub (Feb 1, 2022).

Originally assigned to: @j4james on GitHub.

Description of the new feature/enhancement

There are three methods in the AdaptDefaults interface:

  • The Execute method is never used at all. This is equivalent to the ExecuteChar method in ITerminalApi, which is also not used.
  • The Print method, which takes a char, is ultimately implemented as a call to PrintString, so this could easily be replaced with PrintString in the calling code, as is done in the TerminalDispatch implementation.
  • The PrintString method is all that's left, and that could be moved into the ConGetSet interface, the same way we have a PrintString method in the ITerminalApi interface.

This means the AdaptDispatch class only needs to be constructed with a ConGetSet parameter, which would more closely match the TerminalDispatch class.

Proposed technical implementation details (optional)

Most of the details are covered above. Essentially we'd move the PrintString method into ConGetSet interface and nuke everything else.

Originally created by @j4james on GitHub (Feb 1, 2022). Originally assigned to: @j4james on GitHub. # Description of the new feature/enhancement There are three methods in the [`AdaptDefaults`](https://github.com/microsoft/terminal/blob/fb597ed304ec6eef245405c9652e9b8a029b821f/src/terminal/adapter/adaptDefaults.hpp#L21) interface: * The `Execute` method is never used at all. This is equivalent to the [`ExecuteChar`](https://github.com/microsoft/terminal/blob/62c95b5017e92a780cdc43008e30b4e43d2edc9b/src/cascadia/TerminalCore/ITerminalApi.hpp#L23) method in `ITerminalApi`, which is also not used. * The `Print` method, which takes a char, is ultimately implemented as a call to `PrintString`, so this could easily be replaced with `PrintString` in the calling code, as is done in the [`TerminalDispatch`](https://github.com/microsoft/terminal/blob/main/src/cascadia/TerminalCore/TerminalDispatch.cpp#L29) implementation. * The `PrintString` method is all that's left, and that could be moved into the `ConGetSet` interface, the same way we have a `PrintString` method in the `ITerminalApi` interface. This means the `AdaptDispatch` class only needs to be constructed with a `ConGetSet` parameter, which would more closely match the `TerminalDispatch` class. # Proposed technical implementation details (optional) Most of the details are covered above. Essentially we'd move the `PrintString` method into `ConGetSet` interface and nuke everything else.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#16579