Skip to content

Commit

Permalink
Small helper for the PowerShell 50 char clipboard problem
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanScherer committed May 10, 2017
1 parent e3b4df9 commit c069222
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
4 changes: 4 additions & 0 deletions powershell-50-characters/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM microsoft/windowsservercore
WORKDIR "Program Files"
RUN rd /S /Q WindowsPowerShell\Modules\PSReadLine
WORKDIR /
31 changes: 31 additions & 0 deletions powershell-50-characters/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# PowerShell and the 50 characters clipboard problem

At the moment the `microsoft/windowsservercore` image has the problem
that pasting a longer text will be cut at 50 characters.

Try it with the following command, copy it to clipboard,

```
Write-Host Paste and execute this command does not loose characters.
```

then start an interactive container

```
docker run -it microsoft/windowsservercore powershell
```

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.

A fix could be removing PSReadLine from windowsservercore until it is fixed in PSReadLine module.

```Dockerfile
FROM microsoft/windowsservercore
WORKDIR "Program Files"
RUN rd /S /Q WindowsPowerShell\Modules\PSReadLine
WORKDIR /
```

## See also
- https://github.com/moby/moby/issues/29646
- https://github.com/lzybkr/PSReadLine/issues/460

0 comments on commit c069222

Please sign in to comment.