Set up a codespace with C# toolkits (can be automatically configured when creating codespace on any C# repos).
Wait for setting up, and run the following commands in bash:
dotnet new console -n TestTextCopy
cd ./TestTextCopy
dotnet add package TextCopy
Replace Program.cs with the following code:
using TextCopy;
string text = "Hello World!";
ClipboardService.SetText(text);
dotnet run.
Result
Unhandled exception. System.Exception: Could not execute process. Command line: bash -c "cat /tmp/tmp8us3aw.tmp | xsel -i --clipboard ".
Output:
Error: xsel: Can't open display: (null)
: Inappropriate ioctl for device
at BashRunner.Run(String commandLine) in /_/src/TextCopy/BashRunner.cs:line 42
at LinuxClipboard.InnerSetText(String tempFileName) in /_/src/TextCopy/LinuxClipboard_2.1.cs:line 42
at LinuxClipboard.SetText(String text) in /_/src/TextCopy/LinuxClipboard_2.1.cs:line 29
at TextCopy.ClipboardService.SetText(String text) in /_/src/TextCopy/ClipboardService.cs:line 61
at Program.<Main>$(String[] args) in /workspaces/[ExampleRepo]/TestTextCopy/Program.cs:line 4
Info
Framework (tested):
net6.0
,net7.0
Package version:
6.2.1
Environment: GitHub Codespaces, 4 cores, 16 GB RAM, 32 GB storage
Minimum reproduce steps
Set up a codespace with C# toolkits (can be automatically configured when creating codespace on any C# repos).
Wait for setting up, and run the following commands in bash:
Replace
Program.cs
with the following code:dotnet run
.Result