Commit Graph
34 Commits
Author SHA1 Message Date
George Fleming aab00e2ee1 Fixes UI-related bugs, and migrate Console.Write to myHost.UI.Write 2016-03-23 14:11:04 -07:00
George Fleming e713af87bb Adding support for Ctrl-K, Ctrl-Y, and Ctrl-L 2016-03-23 14:11:04 -07:00
George Fleming cc0b25e515 Pending verification of TreatControlCAsInput 2016-03-23 14:11:04 -07:00
Andrew Schwartzmeyer 1457082fd0 Fix powershell -c 'throw error'
When executing a single command block, two bugs existed.

1) Exceptions were not reported, instead it core dumped
2) The error code was not set, instead 0 was returned

Fixing 1) required calling `Execute` instead of `ExecuteHelper` as the
latter handles exception through `ReportException`.

Fixing 2) required setting the listener's error code when an exception
was thrown, and resetting it for each command when an interactive
session is running.
2016-03-17 13:32:10 -07:00
George Fleming ab3203916b Clean up usage of pipes, as it causes crashes in debugger sub-prompt 2016-02-29 09:51:26 -08:00
Andrew Schwartzmeyer 1b59a60550 Fix compiler warning about unused variable 2016-02-24 16:33:17 -08:00
George Fleming 6776a909b2 Simply code 2016-02-23 15:23:12 -08:00
George Fleming e92c1e80cc Add support for here-string 2016-02-23 15:10:32 -08:00
George Fleming a494516c5d Handle multi-line commands 2016-02-23 12:53:47 -08:00
Andrew Schwartzmeyer 56ed87c108 Respect Console.BackGround color
This was bugging me. Instead of using the existing console's background
color, we were hard-coding "Black." Now we just leave it alone.
2016-02-22 11:29:03 -08:00
George Fleming 1ec5676f25 Fix "handle is invalid" error on AppVeyor 2016-02-12 11:15:57 -08:00
Andrew Schwartzmeyer 89ad38beae Guard prompt function
Fixes #485.
2016-02-05 11:51:17 -08:00
Andrew Schwartzmeyer a4fd57298d Revert "Skip BufferSize when not interactive"
This reverts commit 9a5c010f54.
2016-02-02 17:05:49 -08:00
George Fleming 7e2b25e4d0 Use ConsoleReadLine for script debugger
Instead of Console.ReadLine() so that arrow keys and tab-completion can
be used.
2016-02-01 17:36:30 -08:00
Andrew Schwartzmeyer c162c1c19e Title case ExecuteHelper function 2016-02-01 13:12:29 -08:00
Andrew Schwartzmeyer bbadc64407 Add --noprofile option to host
Disables parsing of all profiles when used.
2016-02-01 13:12:29 -08:00
Andrew Schwartzmeyer 499e5d4142 Remove unsupported --working-dir flag 2016-02-01 12:57:29 -08:00
Andrew Schwartzmeyer 3fcb9ae569 Fix up --help
Moved to argument parsing and cleaned up.
2016-02-01 12:57:29 -08:00
Andrew Schwartzmeyer e6a4c45485 Enable Environment.Exit
Was not previously available.

Moved so `--command` exits with code too.
2016-01-22 14:12:53 -08:00
Andrew Schwartzmeyer 9a5c010f54 Skip BufferSize when not interactive
So short of re-implementing an entire new PSHost for non-interactive
sessions, this is a work-around. If a script (file or command) is passed
to the shell, we tunnel that information through to the raw UI so it can
skip calling out to the TTY (which may not exist).

There has to be a better way to do this, but the structure of PSHost >
UI > Raw UI just makes this incredibly difficult.
2016-01-22 12:40:04 -08:00
v-alexjo 280951089e Added help file for the command line 2016-01-19 12:47:45 -08:00
George Fleming b0e55b9181 Enable PowerShell script debugger 2016-01-19 12:35:13 -08:00
Andrew Schwartzmeyer e4ad1d6603 Reindent and strip whitespace in host 2016-01-15 16:46:39 -08:00
v-alexjo c53144f0d3 Added banner to profile, removed from main 2016-01-15 15:39:42 -08:00
Andrew Schwartzmeyer 08c7d801f8 Execute profile commands with out-default
So functions called in profile can write to the screen without any
workarounds.
2016-01-15 15:39:42 -08:00
Andrew Schwartzmeyer d5f5645f4d Eliminate dependency on native host for shell
PSRP will of course still require it, but now the managed host sets up
the assembly load context, meaning we can depend on the emitted binary
from dotnet-cli.
2015-12-23 16:53:09 -08:00
Andrew Schwartzmeyer 489a951c5d Use System.Environment.NewLine in host 2015-12-22 12:18:51 -08:00
Andrew Schwartzmeyer a2270ceb2d Change access-level of Run() from public to internal 2015-12-22 11:51:26 -08:00
Andrew Schwartzmeyer 548cbc91b1 Bring back InitialSessionState() 2015-12-17 16:08:24 -08:00
v-alexjo 65b2cb9831 Implemented readline, readkey, special keys 2015-12-16 22:34:32 -08:00
Andrew Schwartzmeyer 6fbb220df3 Brought back PowerShell's AssemblyLoadContext
Removes dependency on Microsoft.Extensions.Platform.Abstractions.

Makes use of native executable from `dotnet-cli` impossible; must use
`powershell` from monad-native.
2015-12-08 14:30:24 -08:00
Andrew Schwartzmeyer 04cc9c99d7 Revert "Add runspace test without InitialSessionState"
This reverts commit cc2bdee9ec.

This is no longer neccesary as we're now able to unit test this.
2015-12-02 10:03:34 -08:00
Andrew Schwartzmeyer a574d0200b Temporarily remove InitialSessionState 2015-12-01 13:27:51 -08:00
Andrew Schwartzmeyer d6416e64e2 Move DNX assemblies to src subtree 2015-11-23 17:54:30 -08:00