waf / CSharpRepl

A command line C# REPL with syntax highlighting – explore the language, libraries and nuget packages interactively.
https://fuqua.io/CSharpRepl/
Mozilla Public License 2.0
2.95k stars 112 forks source link

Copy-pasting 🏴󠁧󠁢󠁥󠁮󠁧󠁿 causes crash #325

Open Emik03 opened 11 months ago

Emik03 commented 11 months ago

Version

0.6.6+ba21d409af4dce77f8be07f6a61cdb24cd19bb29

What happened?

Known workaround is to use escape characters.

> "\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f"
🏴󠁧󠁢󠁿
└── 🟡 Length: 14

Causes following log.

2023-12-11T04:35:46 - Trace session starting
2023-12-11T04:35:46 - Starting background initialization
2023-12-11T04:35:46 - Discovered dotnet version .NET Core SDK 8.0.100 at /home/emik/.dotnet/sdk/8.0.100.
2023-12-11T04:35:46 - Available Reference Assemblies: "/home/emik/.dotnet/packs/Microsoft.NETCore.App.Ref": ["5.0.0", "8.0.0-rc.1.23419.4", "6.0.22", "7.0.11", "6.0.23", "7.0.12", "8.0.0-rc.2.23479.6", "6.0.24", "7.0.13", "6.0.25", "7.0.14", "8.0.0", "3.1.0", "3.0.0"]
2023-12-11T04:35:46 - Available Implementation Assemblies: "/home/emik/.dotnet/shared/Microsoft.NETCore.App": ["5.0.17", "6.0.25", "7.0.14", "8.0.0", "3.1.32", "3.0.3", "2.2.7", "2.1.30", "2.0.9"]
2023-12-11T04:35:46 - .NET Version: Microsoft.NETCore.App / 8.0.0
2023-12-11T04:35:46 - Reference Assembly Paths: /home/emik/.dotnet/packs/Microsoft.NETCore.App.Ref/8.0.0/ref/net8.0
2023-12-11T04:35:46 - Implementation Assembly Paths: /home/emik/.dotnet/shared/Microsoft.NETCore.App/8.0.0
2023-12-11T04:35:46 - Shared Framework Paths: /home/emik/.dotnet/shared/Microsoft.NETCore.App/8.0.0
2023-12-11T04:35:46 - Loaded Reference Assemblies: "/home/emik/.dotnet/packs/Microsoft.NETCore.App.Ref/8.0.0/ref/net8.0": ["System.Diagnostics.Contracts.dll", "System.Security.Cryptography.OpenSsl.dll", "Microsoft.VisualBasic.dll", "System.Security.SecureString.dll", "System.Collections.Concurrent.dll", "System.Formats.Asn1.dll", "System.Net.WebProxy.dll", "System.Net.Http.dll", "System.Security.Cryptography.Encoding.dll", "System.Security.AccessControl.dll", "System.Diagnostics.Tracing.dll", "System.Threading.dll", "System.Runtime.Loader.dll", "System.Reflection.Extensions.dll", "System.ValueTuple.dll", "System.IO.MemoryMappedFiles.dll", "System.Xml.Serialization.dll", "System.Diagnostics.FileVersionInfo.dll", "System.Runtime.Serialization.Primitives.dll", "System.Reflection.Emit.dll", "System.Security.Cryptography.Csp.dll", "System.Diagnostics.Process.dll", "System.IO.FileSystem.Watcher.dll", "System.Xml.XPath.XDocument.dll", "System.Diagnostics.TraceSource.dll", "System.Net.Sockets.dll", "Microsoft.Win32.Primitives.dll", "System.Security.Principal.Windows.dll", "System.Reflection.TypeExtensions.dll", "System.Runtime.Serialization.Formatters.dll", "System.Net.Ping.dll", "System.Net.Quic.dll", "System.Data.Common.dll", "System.Console.dll", "System.Buffers.dll", "System.Text.Encoding.dll", "System.Net.WebSockets.Client.dll", "System.Threading.Tasks.dll", "System.Security.dll", "System.Security.Cryptography.Algorithms.dll", "WindowsBase.dll", "System.Threading.Tasks.Dataflow.dll", "System.Diagnostics.StackTrace.dll", "System.Runtime.Handles.dll", "System.Text.Encodings.Web.dll", "System.IO.FileSystem.AccessControl.dll", "System.Net.NetworkInformation.dll", "System.IO.IsolatedStorage.dll", "System.Collections.NonGeneric.dll", "System.Numerics.Vectors.dll", "System.Web.dll", "System.Runtime.Serialization.Xml.dll", "System.ComponentModel.TypeConverter.dll", "System.IO.UnmanagedMemoryStream.dll", "System.Reflection.Emit.Lightweight.dll", "System.Net.WebClient.dll", "System.Xml.XDocument.dll", "System.Collections.Specialized.dll", "System.Xml.ReaderWriter.dll", "System.ComponentModel.DataAnnotations.dll", "Microsoft.VisualBasic.Core.dll", "System.Data.dll", "System.AppContext.dll", "System.Xml.XPath.dll", "System.Security.Cryptography.X509Certificates.dll", "System.Globalization.Calendars.dll", "System.Net.WebSockets.dll", "System.Linq.Queryable.dll", "System.Reflection.DispatchProxy.dll", "System.Globalization.dll", "System.IO.FileSystem.Primitives.dll", "System.Threading.Overlapped.dll", "System.IO.Pipes.dll", "System.Xml.XmlSerializer.dll", "System.Transactions.Local.dll", "Microsoft.Win32.Registry.dll", "System.Security.Cryptography.dll", "System.Threading.Thread.dll", "System.Xml.Linq.dll", "System.Threading.Tasks.Parallel.dll", "System.IO.dll", "System.Runtime.Numerics.dll", "System.Memory.dll", "System.Text.RegularExpressions.dll", "System.Runtime.InteropServices.RuntimeInformation.dll", "System.Runtime.CompilerServices.VisualC.dll", "System.Linq.Parallel.dll", "Microsoft.CSharp.dll", "System.IO.Compression.Brotli.dll", "System.Dynamic.Runtime.dll", "System.ServiceModel.Web.dll", "System.Runtime.InteropServices.JavaScript.dll", "System.Security.Principal.dll", "System.Formats.Tar.dll", "System.Linq.Expressions.dll", "System.Drawing.dll", "System.Drawing.Primitives.dll", "System.Reflection.dll", "System.ServiceProcess.dll", "System.Configuration.dll", "System.Net.HttpListener.dll", "System.Runtime.Extensions.dll", "System.ComponentModel.Annotations.dll", "System.Text.Encoding.CodePages.dll", "System.IO.Compression.dll", "System.ComponentModel.Primitives.dll", "System.Threading.Tasks.Extensions.dll", "System.Threading.Timer.dll", "System.Globalization.Extensions.dll", "System.Resources.Reader.dll", "System.Reflection.Metadata.dll", "System.Net.ServicePoint.dll", "System.Data.DataSetExtensions.dll", "System.Resources.Writer.dll", "System.Runtime.Serialization.Json.dll", "System.Threading.ThreadPool.dll", "System.Net.WebHeaderCollection.dll", "System.Net.Requests.dll", "System.IO.Pipes.AccessControl.dll", "System.Text.Json.dll", "System.IO.FileSystem.DriveInfo.dll", "System.IO.FileSystem.dll", "mscorlib.dll", "System.Net.Security.dll", "System.Diagnostics.Tools.dll", "System.Security.Claims.dll", "System.Security.Cryptography.Primitives.dll", "System.Collections.Immutable.dll", "System.Runtime.Intrinsics.dll", "System.IO.Compression.ZipFile.dll", "System.Net.Primitives.dll", "System.Net.dll", "System.Linq.dll", "System.Threading.Channels.dll", "System.Collections.dll", "System.Text.Encoding.Extensions.dll", "System.ComponentModel.EventBasedAsync.dll", "System.ComponentModel.dll", "System.dll", "System.Resources.ResourceManager.dll", "System.Core.dll", "System.Net.Http.Json.dll", "System.Runtime.InteropServices.dll", "System.Net.Mail.dll", "System.Runtime.dll", "System.Xml.XmlDocument.dll", "System.Reflection.Primitives.dll", "System.Diagnostics.Debug.dll", "System.Web.HttpUtility.dll", "System.Diagnostics.TextWriterTraceListener.dll", "System.Runtime.Serialization.dll", "System.Net.NameResolution.dll", "netstandard.dll", "System.ObjectModel.dll", "System.Xml.dll", "System.Security.Cryptography.Cng.dll", "System.Numerics.dll", "System.Reflection.Emit.ILGeneration.dll", "System.Diagnostics.DiagnosticSource.dll", "System.Transactions.dll", "System.IO.Compression.FileSystem.dll", "System.Runtime.CompilerServices.Unsafe.dll", "System.Windows.dll"]
2023-12-11T04:35:46 - Loaded Implementation Assemblies: "/home/emik/.dotnet/shared/Microsoft.NETCore.App/8.0.0": ["System.Globalization.Calendars.dll", "System.Net.WebSockets.dll", "System.Drawing.dll", "System.Reflection.dll", "System.Configuration.dll", "System.Runtime.Extensions.dll", "System.Text.Encoding.CodePages.dll", "System.ComponentModel.Primitives.dll", "System.Threading.Timer.dll", "System.Resources.Reader.dll", "System.Net.ServicePoint.dll", "System.Resources.Writer.dll", "System.Threading.ThreadPool.dll", "System.Net.Requests.dll", "System.Text.Encoding.Extensions.dll", "System.Reflection.Extensions.dll", "System.ValueTuple.dll", "System.IO.MemoryMappedFiles.dll", "System.Xml.Serialization.dll", "System.Diagnostics.FileVersionInfo.dll", "System.Runtime.Serialization.Primitives.dll", "System.Reflection.Emit.dll", "System.Security.Cryptography.Csp.dll", "System.Diagnostics.Process.dll", "System.IO.FileSystem.Watcher.dll", "System.Xml.XPath.XDocument.dll", "System.Diagnostics.TraceSource.dll", "System.Net.Sockets.dll", "System.Text.Json.dll", "System.IO.FileSystem.dll", "System.ComponentModel.EventBasedAsync.dll", "System.ComponentModel.dll", "System.dll", "System.Resources.ResourceManager.dll", "System.Core.dll", "System.Net.Http.Json.dll", "System.Runtime.InteropServices.dll", "System.Net.Mail.dll", "System.Runtime.dll", "System.Xml.XmlDocument.dll", "System.Reflection.Primitives.dll", "System.Diagnostics.Debug.dll", "System.IO.Pipes.AccessControl.dll", "System.IO.FileSystem.DriveInfo.dll", "System.Diagnostics.Contracts.dll", "System.Security.Cryptography.OpenSsl.dll", "Microsoft.VisualBasic.dll", "System.Security.SecureString.dll", "System.Collections.Concurrent.dll", "System.Formats.Asn1.dll", "System.Net.WebProxy.dll", "System.Net.Http.dll", "System.Security.Cryptography.Encoding.dll", "System.Security.AccessControl.dll", "System.Diagnostics.Tracing.dll", "System.Threading.dll", "System.Web.dll", "System.Runtime.Serialization.Xml.dll", "System.ComponentModel.TypeConverter.dll", "System.Drawing.Primitives.dll", "System.ServiceProcess.dll", "System.Net.HttpListener.dll", "System.ComponentModel.Annotations.dll", "System.IO.Compression.dll", "System.Threading.Tasks.Extensions.dll", "System.Globalization.Extensions.dll", "System.Reflection.Metadata.dll", "System.Data.DataSetExtensions.dll", "System.Runtime.Serialization.Json.dll", "System.Net.WebHeaderCollection.dll", "System.Runtime.Loader.dll", "System.Runtime.Serialization.dll", "System.Net.NameResolution.dll", "netstandard.dll", "System.ObjectModel.dll", "System.Xml.dll", "System.Security.Cryptography.Cng.dll", "System.Numerics.dll", "System.Reflection.Emit.ILGeneration.dll", "System.Diagnostics.DiagnosticSource.dll", "System.Transactions.dll", "System.IO.Compression.FileSystem.dll", "System.Runtime.CompilerServices.Unsafe.dll", "System.Windows.dll", "System.Private.Uri.dll", "System.Web.HttpUtility.dll", "System.Diagnostics.TextWriterTraceListener.dll", "System.Linq.Queryable.dll", "System.Reflection.DispatchProxy.dll", "System.Globalization.dll", "System.IO.FileSystem.Primitives.dll", "System.Threading.Overlapped.dll", "System.IO.Pipes.dll", "System.Xml.XmlSerializer.dll", "System.Transactions.Local.dll", "Microsoft.Win32.Registry.dll", "System.Security.Cryptography.dll", "System.Threading.Thread.dll", "Microsoft.Win32.Primitives.dll", "System.Runtime.Numerics.dll", "System.Memory.dll", "System.Text.RegularExpressions.dll", "System.Runtime.InteropServices.RuntimeInformation.dll", "System.Runtime.CompilerServices.VisualC.dll", "System.Linq.Parallel.dll", "Microsoft.CSharp.dll", "System.IO.Compression.Brotli.dll", "System.Dynamic.Runtime.dll", "System.ServiceModel.Web.dll", "System.Runtime.InteropServices.JavaScript.dll", "System.Security.Principal.dll", "System.Formats.Tar.dll", "mscorlib.dll", "System.Net.Security.dll", "System.Diagnostics.Tools.dll", "System.Security.Claims.dll", "System.Security.Cryptography.Primitives.dll", "System.Collections.Immutable.dll", "System.Runtime.Intrinsics.dll", "System.Private.DataContractSerialization.dll", "System.IO.Compression.ZipFile.dll", "System.Net.Primitives.dll", "System.Net.dll", "System.Linq.dll", "System.Threading.Channels.dll", "System.Collections.dll", "System.Linq.Expressions.dll", "System.IO.UnmanagedMemoryStream.dll", "System.Private.Xml.Linq.dll", "System.Reflection.Emit.Lightweight.dll", "System.Net.WebClient.dll", "System.Xml.XDocument.dll", "System.Collections.Specialized.dll", "System.Xml.ReaderWriter.dll", "System.ComponentModel.DataAnnotations.dll", "Microsoft.VisualBasic.Core.dll", "System.Data.dll", "System.AppContext.dll", "System.Xml.XPath.dll", "System.Security.Cryptography.X509Certificates.dll", "System.Threading.Tasks.dll", "System.Security.dll", "System.Security.Cryptography.Algorithms.dll", "WindowsBase.dll", "System.Private.Xml.dll", "System.Threading.Tasks.Dataflow.dll", "System.Diagnostics.StackTrace.dll", "System.Runtime.Handles.dll", "System.Text.Encodings.Web.dll", "System.IO.FileSystem.AccessControl.dll", "System.Net.NetworkInformation.dll", "System.IO.IsolatedStorage.dll", "System.Collections.NonGeneric.dll", "System.Numerics.Vectors.dll", "System.Xml.Linq.dll", "System.Threading.Tasks.Parallel.dll", "System.IO.dll", "System.Security.Principal.Windows.dll", "System.Private.CoreLib.dll", "System.Reflection.TypeExtensions.dll", "System.Runtime.Serialization.Formatters.dll", "System.Net.Ping.dll", "System.Net.Quic.dll", "System.Data.Common.dll", "System.Console.dll", "System.Buffers.dll", "System.Text.Encoding.dll", "System.Net.WebSockets.Client.dll"]
2023-12-11T04:35:47 - MEF Default Assemblies: /home/emik/.dotnet/tools/.store/csharprepl/0.6.6/csharprepl/0.6.6/tools/net8.0/any/Microsoft.CodeAnalysis.Workspaces.dll, /home/emik/.dotnet/tools/.store/csharprepl/0.6.6/csharprepl/0.6.6/tools/net8.0/any/Microsoft.CodeAnalysis.CSharp.Workspaces.dll, /home/emik/.dotnet/tools/.store/csharprepl/0.6.6/csharprepl/0.6.6/tools/net8.0/any/Microsoft.CodeAnalysis.Features.dll, /home/emik/.dotnet/tools/.store/csharprepl/0.6.6/csharprepl/0.6.6/tools/net8.0
/any/Microsoft.CodeAnalysis.CSharp.Features.dll
2023-12-11T04:35:47 - Background initialization complete
2023-12-11T04:35:47 - Warm-up Starting
2023-12-11T04:35:49 - Warm-up Complete
2023-12-11T04:35:56 - Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at PrettyPrompt.Rendering.Screen.PositionCursor(Screen screen, ConsoleCoordinate cursor)
   at PrettyPrompt.Rendering.Screen..ctor(Int32 width, Int32 height, ConsoleCoordinate cursor, ScreenArea[] screenAreas)
   at PrettyPrompt.Renderer.<RenderOutput>g__Redraw|7_0(<>c__DisplayClass7_0&)
   at PrettyPrompt.Renderer.RenderOutput(PromptResult result, CodePane codePane, OverloadPane overloadPane, CompletionPane completionPane, IReadOnlyCollection`1 highlights, KeyPress key)
   at PrettyPrompt.Prompt.RenderSyntaxHighlightedOutput(Renderer renderer, CodePane codePane, OverloadPane overloadPane, CompletionPane completionPane, KeyPress key, String inputText, PromptResult result)
   at PrettyPrompt.Prompt.ReadLineAsync()
   at CSharpRepl.ReadEvalPrintLoop.RunAsync(Configuration config) in /_/CSharpRepl/ReadEvalPrintLoop.cs:line 49
   at CSharpRepl.Program.Main(String[] args) in /_/CSharpRepl/Program.cs:line 68
   at CSharpRepl.Program.Main(String[] args) in /_/CSharpRepl/Program.cs:line 74
   at CSharpRepl.Program.<Main>(String[] args)