Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make PSReadLine more portable #561

Merged
merged 65 commits into from Oct 16, 2017

Conversation

Projects
None yet
7 participants
@lzybkr
Copy link
Owner

lzybkr commented Oct 16, 2017

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.

lzybkr added some commits Aug 1, 2017

Get red prompt working again
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.
Add basic support for custom colors
Colors can now be customized using RGB (like #RRGGBB) or with escape
sequences.
Merge Foreground/Background options
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.
Introduce runtime check of platform
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.

lzybkr added some commits Sep 5, 2017

Portable custom key bindings
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.

@lzybkr lzybkr referenced this pull request Oct 16, 2017

Closed

Import PowerShell changes #442

@lzybkr lzybkr merged commit 9d592b8 into master Oct 16, 2017

2 checks passed

continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@lzybkr lzybkr deleted the ansi_render branch Nov 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.