Commit Graph
67 Commits
Author SHA1 Message Date
Cursor AgentandDaniel Imms eacf90b2b7 Split common into composite subprojects with project references
- common/tsconfig.json is a solution root referencing layer tsconfigs
- Each layer has composite tsconfig with correct references and outDir
- Break buffer/services cycle via buffer-local service interfaces
- Move cell types, keyboard/unicode types, TaskQueue, and TerminalOptions
- Exclude *.test.ts from composite builds; fix parser IDisposable imports

Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
2026-05-30 17:32:03 +00:00
Cursor AgentandDaniel Imms 6ff26d2c7e Move CircularList to base and colocate ICircularList
Define ICircularList, IInsertEvent, and IDeleteEvent in common/base/CircularList
instead of common/services/Types. Removes the Types ↔ CircularList cycle and
keeps services from depending on Types for base-layer types.

Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
2026-05-30 17:26:10 +00:00
Cursor AgentandDaniel Imms 1d125ac715 Restructure common into layered folders (issue #5963)
Reorganize src/common into platform (base, encoding, data, buffer,
parser, input), integration (services, terminal), and public API layers.

- Move core utilities to common/base/
- Move TextDecoder to common/encoding/
- Move Types, CircularList, Color, TaskQueue, SortedList to common/services/
- Move CoreTerminal, InputHandler, WindowsMode to common/terminal/
- Define ICharset in common/data/Charsets.ts (re-exported from Types)
- Update imports across src/, addons/, and test/
- Add per-layer tsconfig.json files and REARCHITECTURE.md
- Root common/tsconfig.json remains the composite build entry

Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
2026-05-30 16:12:18 +00:00
Daniel Imms e04dd2501f Avoid thrashing timeouts 2026-05-02 05:58:56 -07:00
Daniel Imms 6287c6ddfe Cache/buffer lifecycle 2026-05-02 05:44:13 -07:00
Daniel Imms 52d4b2719c Move cache into Buffer owned object, use WeakRefs
This allows O(1) clearing of the cache, a single TTL timer and we
can avoid making BufferLine's Disposable
2026-05-02 05:32:43 -07:00
Daniel Imms 2e776c0820 Use ILogService in TaskQueue 2026-02-05 06:40:50 -08:00
Daniel Imms bad7e329df Add @typescript-eslint/prefer-nullish-coalescing eslint rule 2026-01-31 08:43:05 -08:00
Daniel Imms 16a13f8504 Fix exception on resize during write
Fixes #5588
2026-01-08 18:03:42 -08:00
Daniel Imms 857c4529cd Save cursor and restore more modes
Fixes #1526
2025-12-30 04:49:54 -08:00
Daniel Imms 663b94011a Remove remnants of deprecated options
Following up on #5462
2025-12-23 08:24:35 -08:00
Daniel Imms 2a5239578a Revert "Merge pull request #5321 from Tyriar/5319"
This reverts commit a260f7d288, reversing
changes made to 2042bb8502.
2025-06-18 06:09:53 -07:00
Daniel Imms e3e11b1a90 Reflow on resize using similar logic to conpty
This aligns reflowing much closer to how conpty does it. This was always
an issue but only became a big issue recently because conpty 1.22+ opts
to passthrough sequences rather than reprinting aggressively. This means
that the conpty buffer being in sync with the xterm.js buffer is more
important, otherwise the cursor will show up in a seemingly random
position.

The existing reflow appears to differ somewhat in conpty, like it seems
to reflow at the word level, not the character level like xterm.js, but
refining that closer if not worth the effort since conpty may end up
relying on the terminal's buffer in the future[1].

Fixes #5319
Fixes #3513
Related #4231
Related microsoft/vscode#241978

[1]: https://github.com/microsoft/terminal/blob/main/doc/specs/%2313000%20-%20In-process%20ConPTY.md
2025-03-14 10:26:32 -07:00
Daniel Imms 65899a9b50 Update src/common/buffer/Buffer.ts 2024-12-12 06:25:36 -08:00
Jacob Bandes-Storch ae2622e5ce Add reflowCursorLine option 2024-12-05 18:03:27 -08:00
Daniel Imms 90ff6f3d06 Migrate most EventEmitter to base/ Emitter 2024-07-14 07:41:56 -07:00
Daniel Imms dd106ae9b8 Speed up clearing all markers, mass event listener dispose
Part of microsoft/vscode#213174
2024-06-03 11:43:31 -07:00
Daniel Imms b6fd7a2b93 Ignore no-unused-vars in test files 2023-08-23 04:42:21 -07:00
Daniel Imms 530f758905 Restrict comments to 100 characters
This is a rule I try enforce in PR but it's a bit of a hassle, this will
give a lint warning when it happens resulting in:

- Yellow underline in supported editors when eslint is installed
- Compilation will succeed since it's a warning not an error
- CI will fail as it does not allow lint warnings

Special case comments are ignored which includes @vt comments, table
comments and commented out code.
2023-08-12 09:04:41 -07:00
Daniel Imms 22140b5e94 Add more granular windowsPty option
See microsoft/vscode#134448
2023-05-29 09:40:00 -07:00
Jörg Breitbart 49ec7199e9 remover iterator and stringIndexToBufferIndex from buffer 2022-12-19 19:50:18 +01:00
Jörg Breitbart a562f33d53 remove nonsense exp runtime of rescans 2022-12-07 19:43:56 +01:00
Jörg Breitbart 309ba47483 change batch size to 500 2022-12-05 20:03:25 +01:00
Jörg Breitbart 4084dc3949 remove _forceMemoryCleanup 2022-12-05 19:10:55 +01:00
Jörg Breitbart 1f5159febe use IdleTaskQueue & Date.now; some testcases 2022-12-03 16:49:26 +01:00
Jörg Breitbart 3a2ae96960 Merge branch 'master' into buffer_optimizations 2022-12-03 11:24:51 +01:00
Daniel Imms 7796b4101a Type Buffer.tabs 2022-10-16 06:58:20 -07:00
Daniel Imms 114924f3fa Add eslint-plugin-jsdoc and enable check-param-names 2022-10-15 08:38:14 -07:00
Jörg Breitbart 14b99dca76 Merge branch 'master' into buffer_optimizations 2022-10-09 21:41:06 +02:00
Daniel Imms 4d97729010 Revert "Merge pull request #4166 from Tyriar/event_with_emitter"
This reverts commit d22f7c9edd, reversing
changes made to 1f8e6f0952.
2022-10-06 09:48:54 -07:00
Daniel Imms ed15a8e170 Create new event with emitter object to simplify code 2022-10-01 08:45:40 -07:00
Jörg Breitbart 785b932d75 lazy cleanup on buffer 2022-09-28 15:57:58 +02:00
Megan Rogge 52044e9aad clear all markers (#3868) 2022-06-21 18:26:02 +00:00
meganrogge 82706e77db add to mockbuffer 2022-03-02 20:19:49 -06:00
Megan RoggeandDaniel Imms 1af22b24c0 Update src/common/buffer/Buffer.ts
Co-authored-by: Daniel Imms <2193314+Tyriar@users.noreply.github.com>
2022-03-02 15:18:29 -06:00
Megan RoggeandDaniel Imms 85dd6a9e87 Update src/common/buffer/Buffer.ts
Co-authored-by: Daniel Imms <2193314+Tyriar@users.noreply.github.com>
2022-03-02 15:18:24 -06:00
Megan Rogge 7bf12f9123 break into two methods 2022-03-02 20:29:31 +00:00
meganrogge f5b66775db during buffer clear, don't dispose of markers on first line 2022-03-02 12:36:35 -06:00
meganrogge ef0312473e re-add i-- so that markers on the same line get disposed of 2022-02-24 12:07:54 -06:00
meganrogge 34ec80a322 use ybase + y when clearing markers 2022-02-24 12:02:11 -06:00
meganrogge e8579bd655 fix marker splice by decrementing index 2022-02-23 16:02:08 -06:00
Daniel Imms da5c24a33f Fix clearMarkers when y=0 and avoid extra indexOf 2022-02-22 06:38:01 -08:00
meganrogge f839a0da8b use splice instead of filter 2022-02-18 17:50:12 -06:00
meganrogge 5b44deaa30 get rid of markers once they've been disposed via clear 2022-02-18 15:38:07 -06:00
meganrogge 7134eaf20c remove trailing space 2022-02-15 11:57:20 -06:00
meganrogge 9847dcaacc fix #3641 2022-02-15 11:38:04 -06:00
meganrogge ac7486856c improve conditional 2022-02-04 17:41:54 -06:00
meganrogge 8999d3948a fix test and improve name 2022-02-04 17:39:37 -06:00
meganrogge e9913522ac fix buffers not clearing 2022-02-04 16:11:04 -06:00
Daniel Imms 1d3c1964f9 Merge branch 'master' into exception_3602 2022-01-11 08:12:24 -08:00