API v3.0
Breaking changes for API v3.0
Breaking changes for API v3.0
Here is a list of breaking changes that happened during the API v3.0 period when differing versions of Terminaux introduced breaking changes.
Between the 2.7.x and 3.0.x version range, we've made the following breaking changes:
The console extensions class needed to be separated to several classes to categorize the functions according to their type. This allows easier organization and distinguishing from the common Terminaux console functions from their extensions.
As a result, we've introduced several extensions that you can see here:
Transformation.Contrast
We've moved all the brightness and the contrast classes and enumerations to the Transformation
namespace. This is to ensure better organzation. The following classes are affected:
ColorBrightness
ColorContrast
ColorContrastType
TextWriterRaw
We've made a breaking change that moves all the raw writing to its own class to reduce confusion. The standard console writer, TextWriterColor
, sets the colors regardless of the mode, while the plain writers are more focused on writing console sequences and other raw things to the terminal.
TermReader
We've discovered that all the ReadLine()
functions and their associated properties and function overloads were duplicates of the TermReader's Read()
function, so we've decided to migrate them to the TermReader
class to avoid inconsistencies for both the application developer and the future versions of Terminaux.
ConsolePlatform
All of its functions have been moved to SpecProbe's Software, so this entire class has been removed.
The sRGB and the linear RGB conversion tools have been moved to the transformation tools as they were used for color transformation. They used to be in the ColorTools
class, but they were used for color transformation formulas, such as color blindness simulation.
DynamicWriters
The following animated writers have been moved to their own category, DynamicWriters
:
TextWriterSlowColor
TextWriterWhereSlowColor
TextWriterWrappedColor
Input
classAs the legacy Input class was made empty by the moving the associated Read*()
functions to TermReader
, we've decided to remove the entire class and move all of the functions to that class.
During the migration, we've renamed DetectKeypress()
to ReadKey()
and added an overload to determine whether we're intercepting the pressed key. The default value is still true
.
Inputs
The color selector class, ColorSelector
, has been moved from Colors.Selector
to Inputs.Styles
as it has been considered to be one of the input styles. This makes it for easier organization of the input styles, such as selection and infoboxes.
Non-generic IEnumerables tend to be more difficult to work with than the generic ones. Therefore, we've decided to switch to using generic IEnumerables. This means that the interactive TUI interface and the base class have become generic.
As a consequence, you'll have to either provide an exact type that your interactive TUI will work with, such as string
or int
, or you'll have to use object
.
InputStyle
To maintain consistency, we've decided to remove the entire class. This is because this class was considered legacy.
Starting from Terminaux 3.0, the clearScreen
variable is no longer needed as the screen feature can now figure out when to or not to clear the screen without your screen instance handling it yourself.
However, both local and global configuration will allow you to control whether to enable or to disable automatic handling of clearing the console in some situations where the default clear handler is not feasible enough.
InputChoiceTools
now returns an array of InputChoiceInfo
All of the InputChoiceTools
, as well as all the input style class functions that use a list of InputChoiceInfo
, have their signatures changed to return an array of InputChoiceInfo
as this return value is not meant to be modified.
We have previously made the blacklist and the graylist for both the terminal types and the terminal emulators. However, each time we need to solve a bug or make an improvement in one of them, we'll have to update all of them to follow suit to avoid inconsistencies in behavior.
As a result, we've merged them to a single class, called ConsoleFilter
, that allows you to manage your console filters without any hitch. We've introduced two enums that will be listed in the console checker page.
All TermInfo source code has been moved to the main library to make it more powerful. The reasons will be listed under a non-ordered list. This changes all TermInfo classes to the Terminaux.Base.TermInfo
namespace.
The main Terminaux library originally included the TermInfo library as a separate NuGet package before being moved to the Terminaux source code. This caused conflicts as we're trying to move all the TermInfo sources to the main library under Terminaux.Base
. We've removed this dependency to maintain consistency and to reduce conflicts.
The idea that using an original TermInfo.Cli application in a script intended to download an NCurses library source code to extract a single file, called Caps
, and to generate source code files under the same application for use with Terminaux's TermInfo is absurd, as users will have to turn on PowerShell script execution manually. Luckily, you can turn on the PowerShell script execution for the process's lifetime. There are Roslyn source generators for this very reason.
We've moved the Inspect feature from the original TermInfo.Cli application to our demo application to be able to use it in the form of an interactive TUI. We've also imported all workable terminfo files from the minimal installation of Ubuntu as embedded resources.
This required us to change the whole Terminaux library to be more nullable-friendly, but we don't currently have plans to make all our libraries nullable-friendly.
waitForInput
removedwaitForInput was accidentally added to almost all the progress information box functions. This variable was possibly a leftover from the regular infobox that provides this variable, which tells the informational box to wait for the user input to make it a modal dialog box.
As a followup to the interactive TUI interface and its associated base class, we've made further modifications to the interactive TUI class by making the three above functions use the generic type instead of relying on the object
type. This eliminates all the necessary casting before being able to use the value directly.
To follow-up the migration of the console color data class generation with the internal generator that parses the console color data JSON file from the resources and makes a data class based on it, we've decided to include the ConsoleColors
enumeration to the generation process. This causes some of the names to be changed.
To align with our goals for Terminaux 3.0 and to make user experience less confusing, we've decided to rename the two color types to their new names listed below in the hint box.
Between the 3.0.x and 3.2.x version range, we've made the following breaking changes:
We've reduced the input choice complexity by replacing a string of answers with input choice tuples to make it easier to specify the choices and to reduce the ambiguity with the slash character.
ConsoleColorsInfo
We've removed this class because it's making things more complicated that it's supposed to be. It's really just a dumbed-down duplicate of ConsoleColorsData
which has more than just the RGB values and a property to return the Color
instance using this data.
As a consequence, the above functions have been changed to no longer return or use this class.
The following presentation properties shown above have been marked as obsolete, because they were initially meant not to be publicly accessible. Due to how the presentation system was implemented, we've made plans to undergo a revamp in a future Terminaux release.
Between the 3.2.x and 3.3.x version range, we've made the following breaking changes:
We've removed the LastOnOverflow()
and the FirstOnUnderflow()
functions from the interface so that they can't be overridden anymore. The reason was that because both of these functions usually didn't need to be modified, and the implementation of them was stable. You can still use these functions, but you can't override them.
As an aside, the Bindings
property's type has been changed from the generic List
of InteractiveTuiBinding
objects to the array of these bindings. This ensures that this property can't be modified once declared.
You can no longer override the two above functions. You can also no longer add key bindings on-demand, but we're working to restore it soon once we find ways to better implement it.
We've reworked this function to return a string instance that indicates the status. This ensures that you can simplify the status population without manually setting the InteractiveTuiStatus.Status
property, which we've internalized its setter as a result of this change.
Before the introduction of SelectionMovement()
and SwitchSides()
, we've allowed you to set the above three properties that described:
the one-based first pane current selection,
the one-based second pane current selection, and
the one-based current pane
However, setting these properties didn't contain sanity checks, so you had to be cautious when setting these properties.
This property shown above used to hold the current password mask to pass to the simple password-enabled terminal reader functions so that that mask was used to read the password input. However, the terminal reader settings already declares the current mask character, PasswordMaskChar
, so we felt that this property was redundant.
Between the 3.3.x and 3.4.x version range, we've made the following breaking changes:
CheckConsoleOnCall
We've removed the GeneralColorTools
class which only contained a property that inhibits the console checker for every assembly, called CheckConsoleOnCall
. The reason was that because the console checker didn't necessarily have to do with the console colors, although the checker evaluates the console and its capabilities, such as the color support.
We've already added assembly-based workarounds, so we've decided to replace this property with console check whitelists. It's necessary to change your code that depends on the console not being checked to add your assembly to the whitelist.
We've maintained the Caps
file unmodified from the for use with our source generator that generates these files without downloading anything off the Internet except NuGet packages. This ensures faster generation (in case NCurses developers decided to modify the Caps file), especially if your build server is disconnected from the Internet. We're trying to cater to the most general and the most simple build methods possible.
However, with respect to the original authors from Spectre.Console's , we've decided to preserve the original license file from that project.
As for NCurses, you can consult to check to see if there are any newer releases. NCurses doesn't get updated too frequently, and may or may not be updated either annually or bi-annually.
It's recommended to either use the available functions to make your own TUI, or use the built-in interactive TUI functionality as mentioned in until this revamp is done.