Commit Graph
46 Commits
Author SHA1 Message Date
Daniel ImmsandCursor cd3dcc52b2 Colocate buffer types in buffer/Types.ts
The import/no-cycle refactor had moved IBuffer, IBufferSet, and related
cell/line types into src/common/Types.ts, with buffer/Types.ts only
re-exporting them. That inverted the natural module boundary and made
buffer code depend on the top-level types hub.

Define buffer-owned types in buffer/Types.ts instead:
- CharData, IExtendedAttrs, IAttributeData, ICellData, IBufferLine
- IMarker, IBuffer, IBufferSet, BufferIndex

Restore UnderlineStyle to buffer/Constants.ts (used by IExtendedAttrs)
and remove those definitions from Types.ts.

buffer/Types.ts imports only what it needs from outside the buffer layer:
ICircularList and ICharset from Types, IDisposable from Lifecycle,
IEvent from Event, and UnderlineStyle from Constants. Types.ts does not
import buffer/Types.ts, so the previous Types <-> buffer cycle stays broken.

Update imports across common, browser, headless, addons, and tests to use
common/buffer/Types for buffer types rather than common/Types.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-31 14:35:08 -07:00
Daniel ImmsandCursor 17ad33dc3d Remove TypeScript path mappings in favor of relative imports
Fixes https://github.com/xtermjs/xterm.js/issues/5896

TypeScript path mappings for common/*, browser/*, and headless/*
were not rewritten in emitted JavaScript, which forced webpack resolve
aliases and NODE_PATH workarounds so runtime could resolve modules.
That added build complexity and broke tooling such as ESLint import/no-cycle.

Changes:
- Convert ~750 imports across src/, addons/, and test/ to relative paths
- Remove common/browser/headless paths and src catch-all mappings from tsconfigs
  (keep @xterm/addon-* demo and addon typings paths)
- Remove webpack resolve.alias for common, browser, headless, and vs
- Drop NODE_PATH from unit tests, benchmarks, and VS Code launch config
- Fix addon-image IIPImageStorage to import ./Types after removing catch-all *

Verified: npm run build, esbuild, package, package-headless
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-31 09:16:10 -07:00
Daniel Imms d911b40a47 Avoid any in test 2026-05-02 05:52:33 -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 671425bf5a Use helpers in other tests 2026-03-09 13:03:00 +09:00
Daniel Imms 8a00898533 Implement blink rendering
Fixes #944
2026-02-03 03:46:21 -08:00
Daniel Imms a513120348 Get dom/width cache tests passing in node 2025-12-30 03:32:34 -08:00
Thomas Zilz aaadefa548 Move WidthCache measure container to helper container 2023-09-15 10:51:31 +02:00
tisilent a1229c78a2 Add cursor initialize test 2023-09-13 18:43:04 +08:00
Daniel Imms 39ae0f45fd Fix selectionForeground dom tests 2023-08-14 04:43:55 -07:00
tisilent c3d8c2a919 Update test and fix 2023-08-11 15:47:50 +08:00
tisilent 482dad3036 Add cursorInactiveStyle option 2023-08-10 16:11:04 +08:00
Jörg Breitbart f407f0c5a6 unit tests 2023-07-31 21:24:39 +02:00
Jörg Breitbart 64d04f0712 optimization: remove document fragment 2023-07-29 23:58:15 +02:00
Jörg Breitbart e848151b50 change to width cache 2023-07-29 17:25:49 +02:00
Jörg Breitbart 5bdd5022b2 some cleanup, use faster str join for classes 2023-07-28 19:33:38 +02:00
Jörg Breitbart 370bad1380 better caching:
- own cache class with flat and holey cache
- use letter spacing
- on-demand measuring
2023-07-28 18:36:01 +02:00
Jörg Breitbart a5df5e7333 first unit tests 2023-07-27 11:25:57 +02:00
Jörg Breitbart 37153018b9 fix BCE 2023-07-24 16:06:19 +02:00
Jörg Breitbart 089dc282c3 fix hover underline 2023-07-22 22:18:12 +02:00
Jörg Breitbart f36954764d faster DOM updates 2023-07-22 11:00:12 +02:00
Daniel Imms 2bfd95fe54 Add support for SGR 53, 55 overline
Specced in ECMA-48
2023-05-20 09:56:56 -07:00
Jörg Breitbart becec91e98 better regexp, fix offset issue in #4294 2022-12-08 17:35:45 +01:00
Jörg Breitbart 3bf72cdefc DOM renderer fix with much better performance 2022-12-05 15:50:29 +01:00
Daniel Imms 6e35bcd767 Use theme service in more places 2022-10-08 13:55:23 -07:00
Daniel Imms eecf52e949 Add lint rule to ensure on prefix is only for event emitters
Fixes #4183
2022-10-08 10:57:31 -07:00
Daniel Imms bff529e1e2 Simplify dom tests and fix assertion 2022-07-30 23:41:08 -07:00
Daniel Imms e0d4384d3c Merge branch 'master' into underline 2022-07-30 06:40:41 -07:00
Daniel Imms 6493679b2e Inactive selection bg in dom renderer
Part of #3803
2022-07-29 11:00:36 -07:00
Daniel Imms 19fb806214 Fix tests 2022-07-23 13:44:12 -07:00
Daniel Imms 8184e0824b Add tests for dom underline styles 2022-07-23 10:13:26 -07:00
Megan RoggeandDaniel Imms bc9c9dd6fd fix #3846 (#3849)
Co-authored-by: Daniel Imms <2193314+Tyriar@users.noreply.github.com>
2022-06-02 18:02:36 +00:00
Daniel Imms 98c40e3f8e Add opaque selection dom renderer tests 2022-05-27 10:46:23 -07:00
Daniel Imms d1a87facfd Fix selectionForeground column select mode on dom/canvas 2022-05-17 12:10:52 -07:00
Daniel Imms d6ad4a4fc3 Remove unneeded dep 2022-05-17 11:41:13 -07:00
Daniel Imms eb96187801 Support selectionForeground in dom
Part of #3810
2022-05-16 10:08:51 -07:00
Daniel Imms 0c6877f46f Move color to common, work with IColor
IColor is needed for the minimum contrast ratio function currently.
2022-05-09 14:00:39 -07:00
Daniel Imms 63eb9a4555 Initial bg/fg renderer decoration proof of concept
Part of #3770
2022-05-09 12:44:51 -07:00
Jörg Breitbart 0c60478953 fix DECTCEM in DOM renderer 2021-10-10 19:36:20 +02:00
Simon Lamon d19a740825 Support strikethrough text style 2021-05-15 17:35:23 +02:00
Daniel Imms b7320794bb Ligature support for dom renderer
Fixes #3283
2021-04-02 10:34:14 -07:00
Daniel Imms ee74130806 Standardize how colors helper lib is structured
Fixes #2604
2019-12-26 12:12:08 +11:00
Daniel Imms 7652cd8af3 Use hash notation over rgb() for dom colors 2019-11-13 06:59:50 -08:00
Daniel Imms a6dcb21f1c Fix tests 2019-11-11 19:30:36 -08:00
Daniel Imms e46ff9ec85 Add minimumContrastRatio to DOM renderer
Part of #322
2019-11-11 19:03:12 -08:00
Daniel Imms a6f4931810 Move DomRendererRowFactory to browser 2019-06-15 23:59:32 -07:00