internal PSReadLinePromptContext(
            PowerShellContext powerShellContext,
            PromptNest promptNest,
            InvocationEventQueue invocationEventQueue,
            PSReadLineProxy readLineProxy)
        {
            _promptNest           = promptNest;
            _powerShellContext    = powerShellContext;
            _invocationEventQueue = invocationEventQueue;
            _consoleReadLine      = new ConsoleReadLine(powerShellContext);
            _readLineProxy        = readLineProxy;

            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                return;
            }

            _readLineProxy.OverrideReadKey(
                intercept => ConsoleProxy.UnixReadKey(
                    intercept,
                    _readLineCancellationSource.Token));
        }
        internal static InvocationEventQueue Create(PowerShellContext powerShellContext, PromptNest promptNest)
        {
            var eventQueue = new InvocationEventQueue(powerShellContext, promptNest);

            eventQueue.CreateInvocationSubscriber();
            return(eventQueue);
        }
Esempio n. 3
0
 public virtual bool IsDebuggerStopped(PromptNest promptNest, Runspace runspace)
 {
     return runspace.Debugger.InBreakpoint || (promptNest.IsRemote && promptNest.IsInDebugger);
 }
 private InvocationEventQueue(PowerShellContext powerShellContext, PromptNest promptNest)
 {
     _promptNest        = promptNest;
     _powerShellContext = powerShellContext;
     _runspace          = powerShellContext.CurrentRunspace.Runspace;
 }