Commit d156a73
Use public InternalHost from origin runspace (#874)
* Use public InternalHost from origin runspace
`ConsoleHost` from `powershell.exe`/`pwsh` still exists within the
runspace created at process start. This change grabs the public
reference to that host while initializing EditorServicesHost. We
can then leverage that host so we can have a much closer to
"default" experience.
This change adds support for the following host members
## $Host.UI
- WriteProgress (including `Write-Progress`)
## $Host.UI.RawUI
- CursorSize (still doesn't work in xterm.js though)
- WindowTitle
- MaxPhysicalWindowSize
- MaxWindowSize
- ReadKey
- GetBufferContents
- ScrollBufferContents
- SetBufferContents
## TODO
[ ] Test RawUI members
[ ] Maybe write sync verison of ReadKey
[ ] Maybe avoid TerminalPSHost* breaking changes (constructors)
* Fix up RawUI.ReadKey
- Add the XML documentation comments to ConsoleProxy because it's more
likely to be used than the interface itself.
- Add a synchronous implementation of ReadKey to ConsoleProxy and use it
in RawUI.ReadKey
- Fix Ctrl + C not returning as input in VSCode's terminal
- Use the exception message from ConsoleHost when ReadKeyOptions do not
include either IncludeKeyUp nor IncludeKeyDown
* Pass $Host in the start up script
* Address feedback
* Address feedback and also add doc comments
* Make progress cache thread safe
* Added comment about null1 parent 029a6cc commit d156a73
File tree
11 files changed
+506
-116
lines changed- module/PowerShellEditorServices
- src
- PowerShellEditorServices.Host
- PowerShellEditorServices
- Console
- Session/Host
11 files changed
+506
-116
lines changedLines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
| 113 | + | |
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
| 22 | + | |
20 | 23 | | |
21 | | - | |
22 | 24 | | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| |||
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
| 67 | + | |
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
| |||
93 | 97 | | |
94 | 98 | | |
95 | 99 | | |
| 100 | + | |
| 101 | + | |
96 | 102 | | |
97 | 103 | | |
98 | 104 | | |
99 | 105 | | |
100 | 106 | | |
101 | 107 | | |
102 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
103 | 138 | | |
104 | 139 | | |
| 140 | + | |
105 | 141 | | |
106 | 142 | | |
107 | 143 | | |
108 | 144 | | |
109 | 145 | | |
110 | 146 | | |
111 | 147 | | |
| 148 | + | |
112 | 149 | | |
113 | 150 | | |
114 | 151 | | |
115 | 152 | | |
116 | | - | |
| 153 | + | |
117 | 154 | | |
118 | | - | |
| 155 | + | |
119 | 156 | | |
120 | 157 | | |
121 | 158 | | |
122 | | - | |
| 159 | + | |
123 | 160 | | |
124 | 161 | | |
125 | 162 | | |
| |||
365 | 402 | | |
366 | 403 | | |
367 | 404 | | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
368 | 413 | | |
369 | 414 | | |
370 | 415 | | |
| |||
377 | 422 | | |
378 | 423 | | |
379 | 424 | | |
380 | | - | |
| 425 | + | |
381 | 426 | | |
382 | 427 | | |
383 | 428 | | |
| |||
419 | 464 | | |
420 | 465 | | |
421 | 466 | | |
422 | | - | |
| 467 | + | |
423 | 468 | | |
424 | 469 | | |
425 | 470 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
34 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
35 | 72 | | |
36 | 73 | | |
37 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
38 | 83 | | |
39 | 84 | | |
40 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
41 | 97 | | |
42 | 98 | | |
43 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
44 | 112 | | |
45 | 113 | | |
46 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
47 | 122 | | |
48 | 123 | | |
49 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
50 | 133 | | |
51 | 134 | | |
52 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
53 | 147 | | |
54 | 148 | | |
55 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
56 | 162 | | |
57 | 163 | | |
58 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
0 commit comments