36 Commits
Author SHA1 Message Date
spaette 486388c59f Fix some typos in this repository (#3547) 2023-01-23 14:22:59 -08:00
Maxime Labelle 0de63689c4 Remove LineIsMultiline in favor of multi-line agnostic algorithms (#1125) (#2047) 2021-02-11 15:57:37 -08:00
Dongbo Wang a2a409d7ad Expose 'ViBackwardChar' and 'ViForwardChar' as bindable functions (#1547) 2020-05-25 22:46:13 -07:00
Dongbo Wang 1f28287f72 Make 'ViForwardChar' able to accept suggestions (#1528) 2020-05-18 14:16:20 -07:00
Dongbo Wang 9e6c6b9481 Add basic support for inline predictive suggestion (#1496) 2020-05-09 15:44:04 -07:00
Dongbo Wang 958ce3aeb2 Fix a few VI edit mode issues (#1262) 2020-01-07 13:08:39 -08:00
Maxime Labelle 9ad8eb6769 Ensure the desired column number is used while moving up or down in VI mode (#1122) 2019-12-09 13:48:14 -08:00
Maxime Labelle 197a3fdc83 In VI mode, moving left or right should stick cursor on logical line (#1120) 2019-10-29 16:56:59 -07:00
Dongbo Wang 7d779cfd35 Fix UpArrow when the cursor is at the end of a wrapped line in a multiple-line text (#1028) 2019-09-12 16:42:08 -07: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 14c5ee0bb2 Fix ExtraPromptLineCount for ClearScreen (#655)
Fix #634.
2018-03-23 09:40:47 -07: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 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 1a623b9327 Replace COORD with Point except in ScreenCapture 2017-09-02 14:43:03 -07:00
Jason Shirk 820e42372a PossibleCompletions fixed, all tests passing 2017-08-14 08:56:22 -07:00
Jason Shirk 855ed7f78c Unify internal and visible cursor updates 2017-07-31 18:08:07 -07:00
Jason Shirk 4aba251bdb Remove unused using directives 2017-07-31 16:44:06 -07:00
Jason Shirk a7c0a907e1 Use null coalescing operator 2017-07-31 16:38:43 -07:00
Jason Shirk 012ec295e5 Use pattern matching w/ is/as 2017-07-31 16:33:03 -07:00
Jason Shirk fc55704f83 Inline out variable parameters 2017-07-31 16:24:57 -07:00
Jason Shirk (POWERSHELL) 04c7233b46 Globally suppress 'default args should not be used' 2016-04-27 16:36:50 -07:00
jason@truewheels.net 2ef73a9f58 Fix off by 1 error in BeginningOfLine
Home on first line of multi-line went to the second character, not the first.
2015-12-16 09:53:44 -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
Jason Shirk (POWERSHELL) 94a6ba40c9 Fix/suppress various FxCop errors 2015-06-18 18:24:23 -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
jason@truewheels.net aa4f616309 Fix ClearScreen to properly scroll
The previous change scrolled the wrong test,
losing the bottom instead of the top of the buffer.
2015-01-21 22:16:00 -08:00
jason@truewheels.net eb67e9397b ClearScreen now clears the screen, not the buffer
ClearScreen is meant to just clear the screen, not the full buffer.
The command cls (or Clear-host) will clear the full buffer.
2014-10-16 17:42:21 -07:00
jason@truewheels.net 6b4cd5bcd4 Better multi-line editing
These changes provide a more seemless editing experience when
the command input has multiple lines.

The history recall functions now avoid recalling history if the
input has multiple lines _and_ we aren't in the middle of
recalling history.  If you do want to edit a recalled multi-line
line (ugh) then you can first use something like LeftArrow then
UpArrow will work like you would want.

BeginningOfLine/EndOfLine have been changed as well.  If you're
already at the start/end of a line, you'll go to the start/end
of the input, otherwise you'll go to the start/end of the line.

Two new functions have been added for moving up/down lines in case
somebody wants to bind those independently of history, but I don't
see those being used much.

Fixes #47
2014-08-06 23:44:07 -07:00
jason@truewheels.net f2e4090162 Change eol behavior for NextWord/ForwardWord
Cmd and bash place the cursor at the end of the last word
instead of one past the end of the word when moving by word.

PSReadline emulated that behavior, but it's inconsistent with
word movement on the rest of the line and it's inconvenient
because you typically need to use the right arrow or end
to edit at the end of the line.

I've removed the emulated behavior, the cursor will now move
to the end of the line.
2014-04-16 08:39:32 -07:00
jason@truewheels.net 900e3057f2 Cleanup some Resharper issues 2014-04-13 11:21:30 -07:00
jason@truewheels.net 2d74f3e6e2 Support digit args for word/character movement 2014-04-13 10:43:57 -07:00
jason@truewheels.net 214f9c01ff Ensure token state matches buffer
There was a small bug where typing very quickly could cause
random errors - incorrect edits or null references.
2014-02-05 22:41:35 -08:00
jason@truewheels.net 33d7829ac9 Add ShellNextWord
ShellForwardWord was behaving like *NextWord or *ForwardWord
depending on the edit mode.

Instead, we should have 2 functions so people can bind as they choose
regardless of the edit mode.
2014-02-04 19:18:49 -08:00
jason@truewheels.net 0adc651828 Refactor code to multiple files 2014-01-12 14:11:04 -08:00