Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various backports from VSMac #89

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open

Conversation

nosami
Copy link
Contributor

@nosami nosami commented Nov 8, 2022

Sorry about this. This PR is a difference between master in this repo and the master branch used in VSMac.

There are various fixes here that we have put into VSMac. Maybe you don't want all of these commits but this can be the start of a discussion.

sgmunn and others added 30 commits April 17, 2020 09:38
the "top" of the buffer.

This appears to happen when we are near the end of the buffer (including
scrollback) and content needs to be squished and overflows out the top
of the buffer. Possible enhancements in the future might be to increase
the scrollback and shift the content but this fixes the immediate crash.

```
XtermSharp.CircularList`1[[XtermSharp.BufferLine, XtermSharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].set_Item(Int32,BufferLine)
XtermSharp.ReflowNarrower.Rearrange(List`1,Int32)
XtermSharp.ReflowNarrower.Reflow(Int32,Int32,Int32,Int32)
XtermSharp.Buffer.Reflow(Int32,Int32)
XtermSharp.Buffer.Resize(Int32,Int32)
XtermSharp.BufferSet.Resize(Int32,Int32)
XtermSharp.Terminal.Resize(Int32,Int32)
```
Fixes a crash when reflowing narrower and content needs to be pushed out the "top" of the buffer.
esctest_DL tests pass
XtermSharp.Buffer.GetChar(Int32,Int32)
XtermSharp.SelectionService.SelectWordOrExpression(Int32,Int32)
XtermSharp.Mac.TerminalView.MouseUp(NSEvent)
Fixes a crash when selecting word or expression
Cols are user visible based, not zero based
Backport code changes made to SwiftTerm which prevent accessing
an array index outside its range when processing escape codes for
foreground and background colours. Code backported:

https://github.com/migueldeicaza/SwiftTerm/blob/d5ab249b56c5a95ba4c505dec8f652ff436e5124/Sources/SwiftTerm/Terminal.swift#L2715-L2791

Error:

XtermSharp.InputHandler.CharAttributes(Int32[])
XtermSharp.InputHandler.<>c__XXX.<.ctor>b__XXX(Int32[],String)
XtermSharp.EscapeSequenceParser.Parse(Byte*,Int32)
XtermSharp.InputHandler.Parse(Byte[],Int32)
XtermSharp.Terminal.Feed(Byte[],Int32)
XtermSharp.Mac.TerminalView.Feed(Byte[],Int32)
XtermSharp.Mac.ProcessTerminalView.ProcessOnData(Byte[])
XtermSharp.Mac.Process.SendOnData(Byte[])
XtermSharp.Mac.LocalProcess.ChildProcessRead(DispatchData,Int32)
CoreFoundation.DispatchIO.Trampoline_DispatchReadWriteHandler(IntPtr,IntPtr,Int32)
…-out-of-range-exception-input-handler-char-attributes

Fix IndexOutOfRangeException processing input
The System.Drawing reference is problematic in Unified Mac apps.
As we are only using this reference for the Point struct, it seemed
prudent to just reimplement this.
…tem-drawing

Use custom Point struct to remove System.Drawing
So that it can be loaded on an M1 Mac
sgmunn and others added 19 commits January 13, 2022 09:46
Calling exit() will disable the CLR diagnostic pipes
On arm64, MAC_TIOCSWINSZ gets padded out and corrupts the winsize values and we end up with incorrect columns and rows.
Update for macos workload RC3 API changes
It seems that it is somehow possible to hit a NRE when selecting text.
See https://devdiv.visualstudio.com/DevDiv/_queries/edit/1582556
…hecks

Add null checking to SelectionService
 * The following functions are the same as mk_wcwidth() and
 * mk_wcswidth(), except that spacing characters in the East Asian
 * Ambiguous (A) category as defined in Unicode Technical Report No.11
 * have a column width of 2. This variant might be useful for users of
 * CJK legacy encodings who want to migrate to UCS without changing
 * the traditional terminal character-width behaviour. It is not
 * otherwise recommended for general use.
Set spacing characters in East Asian Ambiguous (A)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants