Commit Graph
99 Commits
Author SHA1 Message Date
Dongbo Wang fd1265e385 Add the prediction ListView and also hook up with the CommandPrediction APIs introduced in PS 7.1 (#1909) 2020-11-03 14:17:37 -08:00
Dongbo Wang 219ffa17c2 Allow MaximumHistoryCount to be set from user's profile (#1869) 2020-10-09 10:42:26 -07:00
Dongbo Wang b33e222642 Rename 'PredictionColor' to 'InlinePredictionColor' (#1860) 2020-10-08 10:16:28 -07:00
Dongbo Wang a6b0e762b6 Use const strings for some often used ANSI control sequences (#1809) 2020-09-14 12:40:25 -07:00
Dongbo Wang b1736f67d9 Update build to use .NET 3.1 for compliance (#1702) 2020-07-26 10:19:36 -07:00
Dongbo Wang 65d332e277 Reset all VT attributes for PromptText if it contains VT sequences (#1544) 2020-05-21 22:48:15 -07:00
Dongbo Wang 9e6c6b9481 Add basic support for inline predictive suggestion (#1496) 2020-05-09 15:44:04 -07:00
theaquamarine fcb2c9dd48 Add a -Chord parameter to Get-PSReadLineKeyHandler (#1298) 2020-03-31 10:11:54 -07:00
Dongbo Wang 8b778c6119 Correct the default foreground/background colors (#1435) 2020-03-30 15:43:22 -07:00
Jason Shirk 599e1784a9 Improve handling of color in prompts (#1180) 2019-11-25 12:59:09 -08:00
Steve Lee 09300c0990 Return error if color property or value is invalid with Set-PSReadLineOption -Colors (#1124) 2019-11-07 22:57:25 -08:00
Dongbo Wang 394bacc1b5 Make the history file mutext name unique across sessions (#1061) 2019-09-23 16:16:35 -07:00
Dongbo Wang 239955c035 Filter sensitive history items and avoid writing them to the history file (#1058) 2019-09-23 13:20:15 -07:00
Jason Shirk d781e3922e Avoid LanguagePrimitives.TryConvertTo (#784)
LanguagePrimitives.TryConvertTo raises (and catches) exceptions on
failed convertions to an enum type like ConsoleColor.

These exceptions were affecting debugging performance of the menu and we
never want exceptions if it's easy to avoid, which in this case it is.
2018-10-23 12:28:56 -07:00
Parker Snell c6dabcf9f9 Add script block vi mode indicator option 2018-09-12 10:23:59 -07:00
Jason Shirk 4be9473e90 Change selection coloring to not use inverse
Adds Selection as a configuration option for colors.

Fix #597
2017-12-01 13:41:21 -08:00
Jason Shirk e33dabb46c Replace -*Color parameters with single parameter
To make it a bit easier to create themes, the various parameters to
Set-PSReadLineOption to set colors has been replaced with a single
parameter accepting a Hashtable.

The valid keys are:

-- ContinuationPrompt: The color of the continuation prompt.
-- Emphasis: The emphasis color, e.g. the matching text when searching history.
-- Error: The error color, e.g. in the prompt.
-- Default: The default token color.
-- Comment: The comment token color.
-- Keyword: The keyword token color.
-- String: The string token color.
-- Operator: The operator token color.
-- Variable: The variable token color.
-- Command: The command token color.
-- Parameter: The parameter token color.
-- Type: The type token color.
-- Number: The number token color.
-- Member: The member name token color.
2017-11-26 10:51:41 -08:00
Jason Shirk 46d232c22a s/PSReadline/PSReadLine/g
I was terribly inconsistent.

This is a breaking change, though unlikely to cause troubles.
The apis are mostly used in PowerShell scripts which is not
case sensitive.
The cmdlet name change is also mostly safe.

At any rate, this is version 2.0 and breaking changes should be OK.
2017-11-25 21:59:55 -08:00
Jason Shirk 577d1444a0 Use escape for color in Get-PSReadLineOption output 2017-11-16 22:54:59 -08:00
Parker Snell 5b283a947e Implement VT input on Windows (#564)
Fix #158.
2017-11-16 22:22:51 -08:00
Jason Shirk 46eb22fb68 Don't save history if HOME not set 2017-11-12 10:12:25 -08:00
Jason Shirk 3412b1a91b ShowKeyBindings and Get-PSReadlineKeyBinding improvements
Fix #114
2017-11-11 22:55:59 -08:00
Jason Shirk d3e05af42d Make HistoryNoDuplicates true by default
Fix #208
2017-11-07 18:20:11 -08:00
Jason Shirk b303c1dc67 Normalize history save path
Fix #512
2017-11-04 08:30:47 -07:00
Jason Shirk 69d8074f71 Escape escapes in Get-PSReadLineOption output 2017-10-16 15:07:49 -07:00
Jason Shirk fb10c6d9c3 Show tooltips by default in MenuComplete 2017-09-09 15:00:24 -07:00
Jason Shirk a1552f8994 Don't change background on unknown default background 2017-09-04 23:20:52 -07:00
Jason Shirk bff16f4beb Correct resources namespace 2017-09-04 23:20:37 -07:00
Jason Shirk 29951e1b5c Fix for unknown fore/background color on Linux 2017-09-03 19:44:01 -07:00
Oisin Grehan fe5b918883 Ignore case when binding PSReadline keyhandler functions 2017-09-02 22:42:13 -07:00
v-alexjo 1cba31e101 Portable history file settings with XDG support 2017-09-02 22:13:52 -07:00
Andrew Schwartzmeyer c994e145b4 Set DefaultEditMode to Emacs on Linux / OS X 2017-09-02 21:24:07 -07:00
Jason Shirk 245000c3b7 Remove #region 2017-09-02 21:09:40 -07:00
xiaoyinl 6f46b23efe Use HTTPS links for go.microsoft.com
I replace all occurrences of http://go.microsoft.com with https://go.microsoft.com in text files.
2017-09-02 21:03:19 -07:00
Josh Soref ff80a13550 Spelling comments
* spelling: comments in src/Microsoft.PowerShell.PSReadLine
2017-09-02 21:03:11 -07:00
Jason Shirk de5d7bd701 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.
2017-08-14 08:56:22 -07:00
Jason Shirk 138b226ea8 Add basic support for custom colors
Colors can now be customized using RGB (like #RRGGBB) or with escape
sequences.
2017-08-14 08:56:21 -07:00
Jason Shirk ef1bb9be17 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.
2017-08-14 08:56:21 -07:00
Jason Shirk a02554d25d Use expression body property/method 2017-07-31 16:51:25 -07:00
Charu Bassi 166ec54013 User should not be able to set MaxHistoryCount to unsupported value
Validate that MaxHistoryCount lies within the range of 1-int.maxValue.
2016-11-28 17:04:07 -08:00
Dan Thompson 94e1da71d8 Feedback: Rename ChangePSReadlineKeyHandlerCommandBase, remove assert. 2015-12-10 07:26:03 -08:00
Dan Thompson d38c9624b0 Add the ability to change Vi cmd mode dispatch tables. 2015-12-09 22:48:35 -08:00
srdubya ab52d2b642 1st attempt at merge with #251. 2015-06-20 16:47:33 -06:00
Jason Shirk (POWERSHELL) 4fab3e8f0d Change default continuation prompt 2015-06-18 19:28:46 -07:00
Jason Shirk (POWERSHELL) c3cd360740 Change default location for history file 2015-06-18 19:10:18 -07:00
Jason Shirk (POWERSHELL) 94a6ba40c9 Fix/suppress various FxCop errors 2015-06-18 18:24:23 -07:00
Jason Shirk (POWERSHELL) 56490af07d Add a HelpUri for each cmdlet 2015-06-18 15:44:56 -07:00
Jason Shirk (POWERSHELL) c986e0eae5 Rename namespace PSConsoleUtilities to Microsoft.PowerShell 2015-06-18 15:32:20 -07:00
Jason Shirk (POWERSHELL) 6408a4c96c Add copyright header 2015-06-18 15:04:49 -07:00
srdubya e557b0b5b9 Adding Prompt option for ViModeIndicator. Fixing #227 - indicator returns back to None after any other set option. 2015-05-19 20:29:43 -06:00