centrelooki.blogg.se

Github nushell
Github nushell







github nushell

It probably only makes sense to link one bit of text with a particular hyperlink. Hyperlinks (and the terminal/shell-intergration markers for prompt and output location to some extent) are slightly different in that they are still text being printed and "styled" but you only want to do those operations once for a particular AnsiGenericString. As such you also can not really uphold the terminal API requirements for those magic OSCs by wrapping regular text with a particular Style through. The ::title(), ::icon(), and ::cwd() functions don't fit this pattern as they are not characters printed directly in the terminal and instead affect the outside frame of the terminal emulator.

#GITHUB NUSHELL CODE#

This is both convenient and through being directly modifiable may have some reasonably nice runtime performance.īut the OSC code stuff doesn't really fit that bill in my view. paint() print many string segments with that particular style instance. The beauty of having the transparent Style struct in the original ansi_term API in my view is that you can keep a Style instance around and can through. On top of the great points around terminal compatibility by here's my reasoning: I think I am at this point convinced we should go with Option 3 and avoid having those OSC code related behaviors in Style.

github nushell

This would make a breakage to the API a bit more obvious. being able to transparently convert the base style as another crate is valuable.Īs a lesson learned we should probably add a test that constructs and destructures Style manually. I currently favor the latter two options as with the many crates around ANSI styling in the ecosystem e.g.

github nushell

Figure out a way to achieve the same behavior without modifying Style.Accept a basic breaking change that introduces this field.Embrace this breaking change and assume that Style shouldn't be built directly (and maybe hide all fields).Previously this was possible as all fields were marked pub and the types accessible to the outside world. prefix and suffix bits in the Style definition. Used by corresponding public API functions in The style's os control type, if it has one.









Github nushell