Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
BattlefieldDuck committed Jun 28, 2023
1 parent f4aa83b commit 45f8867
Show file tree
Hide file tree
Showing 8 changed files with 1,334 additions and 810 deletions.
66 changes: 62 additions & 4 deletions XtermBlazor/TerminalOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,21 @@ public class TerminalOptions
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? LineHeight { get; set; }

/// <summary>
/// The handler for OSC 8 hyperlinks. Links will use the `confirm` browser
/// API with a strongly worded warning if no link handler is set.
///
/// When setting this, consider the security of users opening these links,
/// at a minimum there should be a tooltip or a prompt when hovering or
/// activating the link respectively.An example of what might be possible is
/// a terminal app writing link in the form `javascript:...` that runs some
/// javascript, a safe approach to prevent that is to validate the link
/// starts with http(s)://.
/// </summary>
// [JsonPropertyName("linkHandler")]
// [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
// public LinkHandler? LinkHandler { get; set; }

/// <summary>
/// What log level to use. The default is 'info'
/// </summary>
Expand Down Expand Up @@ -239,6 +254,14 @@ public class TerminalOptions
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? Scrollback { get; set; }

/// <summary>
/// Whether to scroll to the bottom whenever there is some user input. The
/// default is true.
/// </summary>
[JsonPropertyName("scrollOnUserInput")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? ScrollOnUserInput { get; set; }

/// <summary>
/// The scrolling speed multiplier used for adjusting normal scrolling speed.
/// </summary>
Expand All @@ -263,17 +286,44 @@ public class TerminalOptions
/// <summary>
/// Whether "Windows mode" is enabled. Because Windows backends winpty and
/// conpty operate by doing line wrapping on their side, xterm.js does not
/// have access to wrapped lines. When Windows mode is enabled the following
/// changes will be in effect:<br />
/// <br /><br />
/// - Reflow is disabled.<br />
/// have access to wrapped lines.When Windows mode is enabled the following
/// changes will be in effect:
///
/// - Reflow is disabled.
/// - Lines are assumed to be wrapped if the last character of the line is
/// not whitespace.
///
/// When using conpty on Windows 11 version >= 21376, it is recommended to
/// disable this because native text wrapping sequences are output correctly
/// thanks to https://github.com/microsoft/terminal/issues/405
///
/// @deprecated Use {@link windowsPty}. This value will be ignored if
/// windowsPty is set.
/// </summary>
[JsonPropertyName("windowsMode")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? WindowsMode { get; set; }

/// <summary>
/// Compatibility information when the pty is known to be hosted on Windows.
/// Setting this will turn on certain heuristics/workarounds depending on the
/// values:
///
/// - `if (backend !== undefined || buildNumber !== undefined)`
/// - When increasing the rows in the terminal, the amount increased into
/// the scrollback. This is done because ConPTY does not behave like
/// expect scrollback to come back into the viewport, instead it makes
/// empty rows at of the viewport. Not having this behavior can result in
/// missing data as the rows get replaced.
/// - `if !(backend === 'conpty' and buildNumber >= 21376)`
/// - Reflow is disabled
/// - Lines are assumed to be wrapped if the last character of the line is
/// not whitespace.
/// </summary>
[JsonPropertyName("windowsPty")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public WindowsPty? WindowsPty { get; set; }

/// <summary>
/// A string containing all characters that are considered word separated by the
/// double click to select work logic.
Expand All @@ -289,6 +339,14 @@ public class TerminalOptions
//[JsonPropertyName("windowOptions")]
//[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
//public WindowOptions? WindowOptions { get; set; }

/// <summary>
/// The width, in pixels, of the canvas for the overview ruler. The overview
/// ruler will be hidden when not set.
/// </summary>
[JsonPropertyName("overviewRulerWidth")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? OverviewRulerWidth { get; set; }
}

/// <summary>
Expand Down
44 changes: 44 additions & 0 deletions XtermBlazor/WindowsPty.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using System.Runtime.Serialization;
using System.Text.Json.Serialization;

namespace XtermBlazor
{
/// <summary>
/// Pty information for Windows.
/// </summary>
public class WindowsPty
{
/// <summary>
/// What pty emulation backend is being used.
/// </summary>
[JsonPropertyName("backend")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Backend? Backend { get; set; }

/// <summary>
/// The Windows build version (eg. 19045)
/// </summary>
[JsonPropertyName("buildNumber")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? BuildNumber { get; set; }
}

/// <summary>
/// What pty emulation backend is being used.
/// </summary>
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public enum Backend
{
/// <summary>
/// ConPTY
/// </summary>
[EnumMember(Value = "conpty")]
ConPTY,

/// <summary>
/// WinPTY
/// </summary>
[EnumMember(Value = "winpty")]
WinPTY,
}
}
6 changes: 5 additions & 1 deletion XtermBlazor/XtermBlazor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<Description>Brings xterm.js to Blazor</Description>
<PackageIcon>icon.png</PackageIcon>
<Version>1.8.1</Version>
<Version>1.9.0</Version>
<PackageTags>xterm, xterm-js, blazor, blazor-server, blazor-webassembly, blazor-wasm, xtermblazor</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand All @@ -28,6 +28,10 @@
<ItemGroup>
<WebpackInputs Include="**\*.ts" Exclude="node_modules\**" />
</ItemGroup>

<ItemGroup>
<WebpackInputs Remove="webpack.config.ts" />
</ItemGroup>

<ItemGroup>
<Folder Include="wwwroot\" />
Expand Down
Loading

0 comments on commit 45f8867

Please sign in to comment.