Skip to content

Commit 6930043

Browse files
committed
Merge branch 'develop'
2 parents 5461e37 + d0d7650 commit 6930043

File tree

240 files changed

+6894
-996
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

240 files changed

+6894
-996
lines changed

.github/workflows/api-docs.yml

+30-39
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,44 @@ name: Build and publish API docs
22

33
on:
44
push:
5-
branches: [main]
5+
# only publish v2 (main or develop); v2 is published via the Terminal.GuiV2Docs repo
6+
branches: [main, develop]
7+
8+
permissions:
9+
id-token: write
10+
pages: write
611

712
jobs:
8-
generate-docs:
13+
# Single deploy job since we're just deploying
14+
deploy:
15+
name: Build and Deploy API docs to github-pages
16+
environment:
17+
name: github-pages
18+
url: ${{ steps.deployment.outputs.page_url }}
919
runs-on: windows-latest
10-
1120
steps:
1221
- name: Checkout
1322
uses: actions/checkout@v4
1423

15-
- name: Setup .NET Core
16-
uses: actions/[email protected]
17-
with:
18-
dotnet-version: 6.0.100
19-
20-
- name: Setup DocFX
21-
uses: crazy-max/ghaction-chocolatey@v2
22-
with:
23-
args: install docfx
24-
25-
- name: Install dependencies
26-
run: dotnet restore
27-
2824
- name: DocFX Build
2925
working-directory: docfx
30-
# https://stackoverflow.com/questions/56726429/how-to-run-multiple-commands-in-one-github-actions-docker
3126
run: |
32-
rm ../docs -Recurse -Force -ErrorAction SilentlyContinue
33-
docfx docfx.json
34-
continue-on-error: false
35-
36-
- name: Publish
37-
if: github.event_name == 'push'
38-
uses: peaceiris/actions-gh-pages@v3
27+
dotnet tool install -g docfx
28+
$env:DOCFX_SOURCE_BRANCH_NAME="${{ github.ref_name }}"
29+
docfx metadata
30+
docfx build
31+
continue-on-error: false
32+
33+
- name: Setup Pages
34+
uses: actions/configure-pages@v4
35+
36+
- name: Upload artifact
37+
uses: actions/upload-pages-artifact@v2
3938
with:
40-
github_token: ${{ secrets.GITHUB_TOKEN }}
41-
publish_dir: docs
42-
force_orphan: true
43-
44-
# - name: Use docfx to build API Docs
45-
# uses: nikeee/[email protected]
46-
# with:
47-
# args: docfx/docfx.json
48-
49-
# # Publish generated site using GitHub Pages
50-
# - uses: maxheld83/ghpages@master
51-
# name: Publish API Documentation on GitHub Pages
52-
# env:
53-
# BUILD_DIR: docs # docfx's default output directory is _site
54-
# GH_PAT: ${{ secrets.GH_PAT }} # See https://github.com/maxheld83/ghpages
39+
path: docfx/_site
40+
41+
- name: Deploy to GitHub Pages
42+
id: deployment
43+
uses: actions/deploy-pages@v3
44+
with:
45+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/codeql-analysis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ jobs:
4343

4444
# Initializes the CodeQL tools for scanning.
4545
- name: Initialize CodeQL
46-
uses: github/codeql-action/init@v2
46+
uses: github/codeql-action/init@v3
4747
# Override language selection by uncommenting this and choosing your languages
4848
with:
4949
languages: csharp
5050

5151
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5252
# If this step fails, then you should remove it and run the build manually (see below)
5353
- name: Autobuild
54-
uses: github/codeql-action/autobuild@v2
54+
uses: github/codeql-action/autobuild@v3
5555

5656
# ℹ️ Command-line programs to run using the OS shell.
5757
# 📚 https://git.io/JvXDl
@@ -65,4 +65,4 @@ jobs:
6565
# make release
6666

6767
- name: Perform CodeQL Analysis
68-
uses: github/codeql-action/analyze@v2
68+
uses: github/codeql-action/analyze@v3

.github/workflows/codeql.yml

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ "develop", "main", "v2", "v2_develop" ]
17+
pull_request:
18+
branches: [ "develop", "main", "v2", "v2_develop" ]
19+
schedule:
20+
- cron: '35 4 * * 2'
21+
22+
jobs:
23+
analyze:
24+
name: Analyze
25+
# Runner size impacts CodeQL analysis time. To learn more, please see:
26+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
27+
# - https://gh.io/supported-runners-and-hardware-resources
28+
# - https://gh.io/using-larger-runners
29+
# Consider using larger runners for possible analysis time improvements.
30+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
31+
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
32+
permissions:
33+
actions: read
34+
contents: read
35+
security-events: write
36+
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
language: [ 'csharp', 'javascript-typescript' ]
41+
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
42+
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
43+
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
44+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
45+
46+
steps:
47+
- name: Checkout repository
48+
uses: actions/checkout@v3
49+
50+
# Initializes the CodeQL tools for scanning.
51+
- name: Initialize CodeQL
52+
uses: github/codeql-action/init@v2
53+
with:
54+
languages: ${{ matrix.language }}
55+
# If you wish to specify custom queries, you can do so here or in a config file.
56+
# By default, queries listed here will override any specified in a config file.
57+
# Prefix the list here with "+" to use these queries and those in the config file.
58+
59+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
60+
# queries: security-extended,security-and-quality
61+
62+
63+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
64+
# If this step fails, then you should remove it and run the build manually (see below)
65+
- name: Autobuild
66+
uses: github/codeql-action/autobuild@v2
67+
68+
# ℹ️ Command-line programs to run using the OS shell.
69+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
70+
71+
# If the Autobuild fails above, remove it and uncomment the following three lines.
72+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
73+
74+
# - run: |
75+
# echo "Run, Build Application using script"
76+
# ./location_of_script_within_repo/buildscript.sh
77+
78+
- name: Perform CodeQL Analysis
79+
uses: github/codeql-action/analyze@v2
80+
with:
81+
category: "/language:${{matrix.language}}"

.github/workflows/dotnet-core.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- uses: actions/checkout@v4
1919

2020
- name: Setup .NET Core
21-
uses: actions/setup-dotnet@v3
21+
uses: actions/setup-dotnet@v4
2222
with:
2323
dotnet-version: 7.0
2424
dotnet-quality: 'ga'

.github/workflows/publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
id: gitversion # step id used as reference for output values
3333

3434
- name: Setup dotnet
35-
uses: actions/setup-dotnet@v3
35+
uses: actions/setup-dotnet@v4
3636
with:
3737
dotnet-version: 7.0
3838
dotnet-quality: 'ga'

.gitignore

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ packages
1010

1111
# API Docs
1212
docfx/api
13-
14-
# Never push ./docs folder - the gh-pages branch is now used to publish to GH Pages
15-
docs/
13+
docfx/_site
1614

1715
UnitTests/TestResults
1816

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
***The current, stable, release of Terminal.Gui is [v1.x](https://www.nuget.org/packages/Terminal.Gui). It is stable, rich, and broadly used. The team is now focused on designing and building a significant upgrade we're referring to as `v2`. Therefore:***
1111
* *`v1` is now in maintenance mode, meaning we will accept PRs for v1.x (the `develop` branch) only for issues impacting existing functionality.*
1212
* *All new development happens on the `v2_develop` branch. See the V2 discussion [here](https://github.com/gui-cs/Terminal.Gui/discussions/1940).*
13+
* *The latest v2 API Docs* (generated from `v2_develop`) can be found [here](https://gui-cs.github.io/Terminal.GuiV2Docs/).
1314
* *Developers are encouraged to continue building on [v1.x](https://www.nuget.org/packages/Terminal.Gui) until we announce `v2` is stable.*
1415

1516
**Terminal.Gui**: A toolkit for building rich console apps for .NET, .NET Core, and Mono that works on Windows, the Mac, and Linux/Unix.
@@ -35,7 +36,7 @@ dotnet run
3536
* [Terminal.Gui Overview](https://gui-cs.github.io/Terminal.Gui/articles/overview.html)
3637
* [List of Views/Controls](https://gui-cs.github.io/Terminal.Gui/articles/views.html)
3738
* [Conceptual Documentation](https://gui-cs.github.io/Terminal.Gui/articles/index.html)
38-
* [API Documentation](https://gui-cs.github.io/Terminal.Gui/api/Terminal.Gui/Terminal.Gui.html)
39+
* [API Documentation](https://gui-cs.github.io/Terminal.Gui)
3940

4041
_The Documentation matches the most recent Nuget release from the `main` branch ([![Version](https://img.shields.io/nuget/v/Terminal.Gui.svg)](https://www.nuget.org/packages/Terminal.Gui))_
4142

ReactiveExample/ReactiveExample.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
<InformationalVersion>1.14.0-pre.1+Branch.develop.Sha.e0b7464669ef87b96b57f2285200e02bcf85d0e7</InformationalVersion>-->
1111
</PropertyGroup>
1212
<ItemGroup>
13-
<PackageReference Include="ReactiveUI.Fody" Version="19.4.1" />
14-
<PackageReference Include="ReactiveUI" Version="19.4.1" />
15-
<PackageReference Include="ReactiveMarbles.ObservableEvents.SourceGenerator" Version="1.2.3" PrivateAssets="all" />
13+
<PackageReference Include="ReactiveUI.Fody" Version="19.5.39" />
14+
<PackageReference Include="ReactiveUI" Version="19.5.39" />
15+
<PackageReference Include="ReactiveMarbles.ObservableEvents.SourceGenerator" Version="1.3.1" PrivateAssets="all" />
1616
</ItemGroup>
1717
<ItemGroup>
1818
<ProjectReference Include="..\Terminal.Gui\Terminal.Gui.csproj" />

Terminal.Gui/ConsoleDrivers/CursesDriver/CursesDriver.cs

+72-8
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ void ProcessInput ()
341341
Key k = Key.Null;
342342

343343
if (code == Curses.KEY_CODE_YES) {
344+
var lastWch = wch;
344345
while (code == Curses.KEY_CODE_YES && wch == Curses.KeyResize) {
345346
ProcessWinChange ();
346347
code = Curses.get_wch (out wch);
@@ -379,6 +380,25 @@ void ProcessInput ()
379380
} else if (wch >= 325 && wch <= 327) { // Shift+Alt+(F1 - F3)
380381
wch -= 60;
381382
k = Key.ShiftMask | Key.AltMask | MapCursesKey (wch);
383+
} else {
384+
code = Curses.get_wch (out wch);
385+
if (code == 0) {
386+
switch (wch) {
387+
// Shift code.
388+
case 16:
389+
keyModifiers.Shift = true;
390+
break;
391+
default:
392+
if (lastWch == Curses.KeyResize && wch == 91) {
393+
// Returns this keys to the std input which is a CSI (\x1b[).
394+
Curses.ungetch (91); // [
395+
Curses.ungetch (27); // Esc
396+
return;
397+
} else {
398+
throw new Exception ();
399+
}
400+
}
401+
}
382402
}
383403
keyDownHandler (new KeyEvent (k, MapKeyModifiers (k)));
384404
keyHandler (new KeyEvent (k, MapKeyModifiers (k)));
@@ -388,8 +408,6 @@ void ProcessInput ()
388408

389409
// Special handling for ESC, we want to try to catch ESC+letter to simulate alt-letter as well as Alt-Fkey
390410
if (wch == 27) {
391-
Curses.timeout (10);
392-
393411
code = Curses.get_wch (out int wch2);
394412

395413
if (code == Curses.KEY_CODE_YES) {
@@ -425,6 +443,56 @@ void ProcessInput ()
425443
} else if (wch >= (uint)Key.A && wch <= (uint)Key.Z) {
426444
keyModifiers.Shift = true;
427445
keyModifiers.Alt = true;
446+
} else if (wch2 == Curses.KeySS3) {
447+
while (code > -1) {
448+
code = Curses.get_wch (out wch2);
449+
if (code == 0) {
450+
switch (wch2) {
451+
case 16:
452+
keyModifiers.Shift = true;
453+
break;
454+
case 108:
455+
k = (Key)'+';
456+
break;
457+
case 109:
458+
k = (Key)'-';
459+
break;
460+
case 112:
461+
k = Key.InsertChar;
462+
break;
463+
case 113:
464+
k = Key.End;
465+
break;
466+
case 114:
467+
k = Key.CursorDown;
468+
break;
469+
case 115:
470+
k = Key.PageDown;
471+
break;
472+
case 116:
473+
k = Key.CursorLeft;
474+
break;
475+
case 117:
476+
k = Key.Clear;
477+
break;
478+
case 118:
479+
k = Key.CursorRight;
480+
break;
481+
case 119:
482+
k = Key.Home;
483+
break;
484+
case 120:
485+
k = Key.CursorUp;
486+
break;
487+
case 121:
488+
k = Key.PageUp;
489+
break;
490+
default:
491+
k = (Key)wch2;
492+
break;
493+
}
494+
}
495+
}
428496
} else if (wch2 < 256) {
429497
k = (Key)wch2;
430498
keyModifiers.Alt = true;
@@ -559,7 +627,6 @@ void ProcessContinuousButtonPressed (MouseFlags mouseFlag, Point pos)
559627
public override void PrepareToRun (MainLoop mainLoop, Action<KeyEvent> keyHandler, Action<KeyEvent> keyDownHandler, Action<KeyEvent> keyUpHandler, Action<MouseEvent> mouseHandler)
560628
{
561629
// Note: Curses doesn't support keydown/up events and thus any passed keyDown/UpHandlers will never be called
562-
Curses.timeout (0);
563630
this.keyHandler = keyHandler;
564631
this.keyDownHandler = keyDownHandler;
565632
this.keyUpHandler = keyUpHandler;
@@ -572,9 +639,7 @@ public override void PrepareToRun (MainLoop mainLoop, Action<KeyEvent> keyHandle
572639
return true;
573640
});
574641

575-
mLoop.WinChanged += () => {
576-
ProcessInput ();
577-
};
642+
mLoop.WinChanged += () => ProcessWinChange ();
578643
}
579644

580645
public override void Init (Action terminalResized)
@@ -585,6 +650,7 @@ public override void Init (Action terminalResized)
585650
try {
586651
window = Curses.initscr ();
587652
Curses.set_escdelay (10);
653+
Curses.nodelay (window.Handle, true);
588654
} catch (Exception e) {
589655
throw new Exception ($"Curses failed to initialize, the exception is: {e.Message}");
590656
}
@@ -673,13 +739,11 @@ public override void Init (Action terminalResized)
673739

674740
ResizeScreen ();
675741
UpdateOffScreen ();
676-
677742
}
678743

679744
public override void ResizeScreen ()
680745
{
681746
Clip = new Rect (0, 0, Cols, Rows);
682-
Curses.refresh ();
683747
}
684748

685749
public override void UpdateOffScreen ()

0 commit comments

Comments
 (0)