73 Commits
Author SHA1 Message Date
Dongbo Wang c5d1187179 Place 'ViDGChord' in the right group (#3422) 2022-08-29 10:29:21 -07:00
Enan Ajmain 6808c18762 Add support for upcasing, downcasing, and capitalizing word (#3365) 2022-07-18 10:26:40 -07:00
Dongbo Wang 2ef36fb77c Enable IntelliSense prediction by default (#3351) 2022-06-22 12:15:17 -07:00
Dongbo Wang 4b239f2436 Add white spaces to the emacs dispatch table (#2223) 2021-02-17 15:47:46 -08:00
Dongbo Wang 6ed95a23d5 Add the SelectCommandArgument bind-able function (#2222) 2021-02-17 15:25:27 -08:00
Dongbo Wang bbb729c214 Move prediction functions to a new group (#2211) 2021-02-11 22:41:24 -08:00
Aditya Patwardhan 6cf129ee35 Add the "Dynamic Help" feature to PSReadLine (#1777)
- Adds a way to view help on alternate screen buffer for full help and uses a Pager from `Microsoft.PowerShell.Pager`.
- Implements dynamic help for parameters by showing it below the current command line like `MenuComplete`.
2021-02-10 17:04:50 -08:00
Maxime Labelle 47fb95728c Make d0 to delete to the start of the current logical line in a multiline buffer in VI mode (#2002) 2021-02-09 21:45:37 -08:00
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
Maxime Labelle a45ab815a8 vi-mode: Add dgg to delete from the beginning of the buffer to the current logical line (#1752) 2020-09-10 11:45:27 -07:00
Maxime Labelle 70249682ed vi-mode: Use dk to delete the previous n logical lines and the current logical line in a multi-line buffer (#1737) 2020-08-12 12:00:22 -07:00
Maxime Labelle 1d3964160d vi-mode - Make 'dj' delete the current and next n logical lines (#1697) 2020-07-29 16:51:15 -07:00
Maxime Labelle c7ef3bd0f6 vi-mode: Add 'dG' to delete to the end of multiline buffer (#1692) 2020-07-25 11:06:54 -07:00
Dongbo Wang a2a409d7ad Expose 'ViBackwardChar' and 'ViForwardChar' as bindable functions (#1547) 2020-05-25 22:46:13 -07:00
Dongbo Wang 9e6c6b9481 Add basic support for inline predictive suggestion (#1496) 2020-05-09 15:44:04 -07:00
Tyler James Leonhardt 5afeced01f Revert "Change the key binding 'Alt+D' to 'Alt+Shift+D' for the windows edit mode (#1037)" (#1040)
This reverts commit 3f6975c1a0.
2019-09-12 23:03:57 -07:00
Tyler James Leonhardt 3f6975c1a0 Change the key binding 'Alt+D' to 'Alt+Shift+D' for the windows edit mode (#1037) 2019-09-12 13:37:28 -07:00
Dongbo Wang d6b120a99b Make PageUp/PageDown and CtrlPageUp/CtrlPageDown windows only (#1032)
On Unix platforms, `Console.SetWindowPosition` throw `PlatformNotSupportedException`.
2019-09-11 14:36:05 -07:00
Tyler James Leonhardt e48613665a added xtermjs keybindings (#878) 2019-04-07 11:18:04 -07:00
Jason Shirk a7af25aa37 Stop dispatching on ConsoleKeyInfo (#831)
There are likely issues introduced by this PR,
but I'm merging for a new Beta so this code gets more testing.

* Introduce PSKeyInfo type alias
* Explicit conversions b/w ConsoleKeyInfo and PSKeyInfo
* Change tests to use actual ConsoleKeyInfo data
* Add fr-FR keyboard layout tests
* Add KeyInfo-ru-RU-windows.json (#839)

All impossible without Shift shortcuts labeled as "Investigate: true"
Alt+Spacebar tracked by windows itself

* Add KeyInfo for Polish (Programmers) layout on Windows and Linux (#870)

On Windows *Alt+Spacebar* is hijacked by Windows
On Linux any *Alt+F1-12* combination was not detected
2019-03-20 16:14:05 -07:00
Jason Shirk 3d246d935f Remove Keys.ShouldInsert (#822)
The method Keys.ShouldInsert was a misguided attempt to avoid inserting
keys where there is no binding but the key really doesn't make sense as
input.

Unfortunately it is just causing more pain and probably wasn't
addressing a serious problem, so I'm removing it.

Fix #798
2018-12-03 11:04:40 -08:00
Maxime Labelle 274381a89e Support vi mode 'G' and 'gg' movements in multi-line buffers (#793)
Fix #789
2018-11-05 12:34:17 -08:00
Jason Shirk bc40ae6f6b Remove uses of CSI # S / ScrollConsoleScreenBuffer (#790)
This fixes some weird issues in WSL and some Linux terminals.

This also works around a Windows 1809 Console bug for the Ctrl+l binding
to clear the screen by using the same escape sequence that bash uses.

Fix #724
2018-11-04 19:12:52 -08:00
Dongbo Wang 708787f8f5 Fix Ctrl+Backspace/Ctrl+h in Linux (#661)
Fix #619
2018-04-02 21:38:51 -07: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 193b4da3ac Fix cursor placement after history replacement
A fix for vi mode broke placing the cursor after recalling commands from
history.

There was also a small inconcistency in placing the cursor in vi mode
when in command mode.

Fix #592
2017-11-25 21:30:45 -08:00
Jason Shirk 9094f1246b Generate parts of the about topic
To keep the about topic up to date, the function descriptions and key
binding information is now generated after a build.
2017-11-24 22:11:13 -08:00
Jason Shirk 3412b1a91b ShowKeyBindings and Get-PSReadlineKeyBinding improvements
Fix #114
2017-11-11 22:55:59 -08:00
Jason Shirk 964f551f8f Fix wrapping on resize and column width of ShowKeyBindings 2017-11-11 20:42:56 -08:00
Jason Shirk 647da395dc Invoke external editor w/o AcceptLine
Also add binding for Ctrl+x,Ctrl+e in Emacs mode.

Fix #339, #478
2017-11-05 19:54:00 -08:00
Jason Shirk c0faad2533 Add default binding Shift+Insert for paste
Fix #484
2017-11-04 09:49:03 -07:00
Jason Shirk 63d2dcf6da 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.
2017-10-15 22:03:56 -07:00
Jason Shirk 9374839865 Fix WhatIsKey/ShowKeyBindings 2017-09-09 16:23:27 -07:00
Jason Shirk bff16f4beb Correct resources namespace 2017-09-04 23:20:37 -07:00
Andrew Schwartzmeyer 491a1ecdc9 Fix comparison of keys in dispatch dictionary
This compares the keys by a combination of their ConsoleKey and
Modifiers fields. We cannot compare the KeyChar field as it is
platform (and TTY configuration) dependent.
2017-09-04 20:42:47 -07:00
Andrew Schwartzmeyer c994e145b4 Set DefaultEditMode to Emacs on Linux / OS X 2017-09-02 21:24:07 -07:00
Josh Soref ff80a13550 Spelling comments
* spelling: comments in src/Microsoft.PowerShell.PSReadLine
2017-09-02 21:03:11 -07:00
Jason Shirk 1a623b9327 Replace COORD with Point except in ScreenCapture 2017-09-02 14:43:03 -07:00
Jason Shirk 6371443365 Use object initializer syntax 2017-07-31 17:36:37 -07:00
Jason Shirk a02554d25d Use expression body property/method 2017-07-31 16:51:25 -07:00
Jason Shirk 4aba251bdb Remove unused using directives 2017-07-31 16:44:06 -07:00
Jason Shirk fc55704f83 Inline out variable parameters 2017-07-31 16:24:57 -07:00
Jason Shirk b823045bb2 Remove unnecessary ref on parameter to PlaceCursor 2017-07-31 15:55:29 -07:00
andrewcromwell e1dcaaeded Character swapping fixes (#538)
* allow swapping at end of line
* add SwapCharacters to default emacs keybindings
* limit cursor location in SwapCharacters (vi mode)
* add SwapCharacters to insert mode vi bindings
2017-06-06 09:10:56 -07:00
Jason Shirk (POWERSHELL) 04c7233b46 Globally suppress 'default args should not be used' 2016-04-27 16:36:50 -07:00
Jason Shirk (POWERSHELL) 6f741c5421 Startup improvements
- Delay loading resources until they are used
- Delay creating vi mode key handler tables
- Remove format.ps1xml file
2016-01-17 08:58:07 -08:00
jason@truewheels.net 64ffb085e0 Merge branch 'master' of https://github.com/rkeithhill/PSReadLine into rkeithhill-master
Conflicts:
	PSReadLine/PSReadLine.csproj
	PSReadLine/PSReadLineResources.Designer.cs
	PSReadLine/PSReadLineResources.resx
	PSReadLine/ReadLine.cs
2015-12-16 09:41:00 -08:00
jason@truewheels.net 8691e88595 Initial refactor console api usage
To get the unit tests passing in VS2015, and to help w/ possible future hosts,
I've moved most of the console api usage to a class, which is then mocked
in the unit tests.
2015-12-06 09:05:37 -08:00
Keith Hill b0b441c080 Added InsertLineAbove and InsertLineBelow functions and set them up to key bind to Ctrl+Enter and Ctrl+Shift+Enter in Windows mode. Not being an emacs person, I'm not sure what key bindings these two functions would bind to. I also added unit tests for the two functions as well as a unit test for what I believe is a bug in the BeginningOfLine (home) function when in multiline mode. I also updated the project to have the appropriate default namespace so that the resource file gets re-generated with the correct resource name without having to resort to hacking the csproj file. There was also an issue with trying to run unit tests because the unit test setup of PSReadline sets engineInstrincs to null and that caused a null reference exception which I worked-around by testing for null first. 2015-07-20 19:54:33 -06:00
Jason Shirk (POWERSHELL) 9a85eed48d Change Enter back to AcceptLine
AcceptAndValidateLine still has some problems, so the default has been changed back to AcceptLine.
2015-06-18 18:50:48 -07:00