-
Notifications
You must be signed in to change notification settings - Fork 360
Open
Labels
breakingPull requests that introduce breaking changesPull requests that introduce breaking changesdependenciesPull requests that update a dependency filePull requests that update a dependency filegoPull requests that update Go codePull requests that update Go code
Description
A new major version of the Tcell library has been recently been released, which includes breaking changes that need to be addressed in the code. I have analyzed the codebase briefly and compiled a list of potential changes that should be made:
- The
PollEventfunction should be replaced with theEventQchannel where terminal events can be directly read from. - The
Style.Decomposefunction has been removed, which means it might no longer be possible to implement the SGR 8 terminal sequence (concealed text) as Tcell does not support it directly. However I think it is a niche feature that isn't necessary to have, and the current implementation is a hacky workaround that sets the foreground color to the background color. KeyBackspace2will no longer be sent, and will instead be mapped toKeyBackspace. This means that support for the<backspace2>key can dropped as<backspace>alone will be sufficient.EventKeynow contains astringinstead of arune, and the code needs to be changed for both reading keys (EventKeytostring) and pushing keys (stringtoEventKey).- The special keys
KeyCtrlSpace,KeyCtrlLeftSq,KeyCtrlRightSq,KeyCtrlBackslash,KeyCtrlCaratandKeyCtrlUnderscorehave been removed, and are instead represented as a rune key with theModCtrlmask. This is problematic because special keys and rune keys have different processing logic so it will have to be adjusted to handle the new changes. Perhaps it is worth creating utility functions for converting betweenEventKeyandstring, which can then be unit tested. - The existing
SetContentfunction is used to assign runes to individual cells, however there are now high-levelPutStr/PutStrStyledfunctions for writing entire strings, and from my testing it appears to support terminal sequences inside those strings, but it may not work for every case. I am fine with leaving the existingwin.printunchanged for now.
Some of these changes are straightforward, but that may not be the case for others. Fortunately I have just released a new version of lf, so there will be ample time to test the new changes before releasing them in the following version.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
breakingPull requests that introduce breaking changesPull requests that introduce breaking changesdependenciesPull requests that update a dependency filePull requests that update a dependency filegoPull requests that update Go codePull requests that update Go code