Repository navigation
Make PSReadLine more portable - #561
Merged
Merged
Conversation
Mostly to keep tests happy.
With no portable way to scrape, displaying red in the prompt is harder. To start, there is a new option to specify the end of the prompt text so you can specify exactly what should turn red. Many folks won't use this, so there are some smarts added at startup to analyze the prompt function - if it's "pure", as in, doesn't call any methods or commands, we call it and infer the invariant part of the prompt, basically the last non-whitespace character plus the trailing whitespace.
Colors can now be customized using RGB (like #RRGGBB) or with escape sequences.
Fix selection to use escape sequence for invert - it doesn't look that great when there are too many colors, but it will work with any customization. Also fix tests to work after previous commit.
In the move to producing a single binary for a protable module, we'll need some runtime checks - so I've add a single one which also requires a dependency on new NuGet package.
Rewrote the custom key binding code to be more portable. Some runtime checks are necessary because of impossible to reconcile differences. Some Win32 P/Invoke calls are still needed due to lack of information in the ConsoleKeyInfo. Some keys are currently not available on Linux due to a CLR bug, others aren't available ever because terminals don't unique character sequences for a given key press that might differ in just the Shift or Ctrl state.
This was referenced Oct 16, 2017
Closed
This was referenced Oct 31, 2017
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All of the changes from PowerShell/PowerShell have been integrated or redone.
All rendering is now down with ANSI escape sequences and the core rendering no longer uses Windows specific data structures or apis.
Custom key binding code was rewritten in an attempt to accommodate platform differences, but we still need some P/Invokes on Windows, t.b.d. on Linux.
The PR includes a few internationalization fixes - cursor placement for CJK, plus improved handling of key bindings for less common keyboard layouts.
One new feature in this PR - tooltips are always displayed unless they don't add anything useful (same as the completion). They are only displayed below the menu instead of the old style which truncated the tooltip.