Skip to content

Commit c069222

Browse files
committed
Small helper for the PowerShell 50 char clipboard problem
1 parent e3b4df9 commit c069222

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM microsoft/windowsservercore
2+
WORKDIR "Program Files"
3+
RUN rd /S /Q WindowsPowerShell\Modules\PSReadLine
4+
WORKDIR /

powershell-50-characters/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# PowerShell and the 50 characters clipboard problem
2+
3+
At the moment the `microsoft/windowsservercore` image has the problem
4+
that pasting a longer text will be cut at 50 characters.
5+
6+
Try it with the following command, copy it to clipboard,
7+
8+
```
9+
Write-Host Paste and execute this command does not loose characters.
10+
```
11+
12+
then start an interactive container
13+
14+
```
15+
docker run -it microsoft/windowsservercore powershell
16+
```
17+
18+
Now paste your clipboard into it (I also can repro it from my Mac pasting it into a Windows container). The command is missing the last two words. Try it again in microsoft/nanoserver and it will work.
19+
20+
A fix could be removing PSReadLine from windowsservercore until it is fixed in PSReadLine module.
21+
22+
```Dockerfile
23+
FROM microsoft/windowsservercore
24+
WORKDIR "Program Files"
25+
RUN rd /S /Q WindowsPowerShell\Modules\PSReadLine
26+
WORKDIR /
27+
```
28+
29+
## See also
30+
- https://github.com/moby/moby/issues/29646
31+
- https://github.com/lzybkr/PSReadLine/issues/460

0 commit comments

Comments
 (0)