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>
28 lines
1.3 KiB
TypeScript
28 lines
1.3 KiB
TypeScript
/**
|
|
* Copyright (c) 2019 The xterm.js authors. All rights reserved.
|
|
* @license MIT
|
|
*/
|
|
|
|
import { CHAR_DATA_CODE_INDEX, NULL_CELL_CODE, WHITESPACE_CELL_CODE } from './buffer/Constants';
|
|
import { IBufferService } from './services/Services';
|
|
|
|
export function updateWindowsModeWrappedState(bufferService: IBufferService): void {
|
|
// Winpty does not support wraparound mode which means that lines will never
|
|
// be marked as wrapped. This causes issues for things like copying a line
|
|
// retaining the wrapped new line characters or if consumers are listening
|
|
// in on the data stream.
|
|
//
|
|
// The workaround for this is to listen to every incoming line feed and mark
|
|
// the line as wrapped if the last character in the previous line is not a
|
|
// space. This is certainly not without its problems, but generally on
|
|
// Windows when text reaches the end of the terminal it's likely going to be
|
|
// wrapped.
|
|
const line = bufferService.buffer.lines.get(bufferService.buffer.ybase + bufferService.buffer.y - 1);
|
|
const lastChar = line?.get(bufferService.cols - 1);
|
|
|
|
const nextLine = bufferService.buffer.lines.get(bufferService.buffer.ybase + bufferService.buffer.y);
|
|
if (nextLine && lastChar) {
|
|
nextLine.isWrapped = (lastChar[CHAR_DATA_CODE_INDEX] !== NULL_CELL_CODE && lastChar[CHAR_DATA_CODE_INDEX] !== WHITESPACE_CELL_CODE);
|
|
}
|
|
}
|