-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Search addon overflows wrapped text matches to the right #5336
Copy link
Copy link
Closed
Labels
Milestone
Description
Details
- Browser and browser version: Chrome 125.0.6422.76
- OS version: Zorin OS 17.2 (Ubuntu 22.04)
- xterm.js version: v5.5.0
Steps to reproduce
- Create a vite example app (or anything you want really)
- Implement the addon-search
Minimal example
import { useEffect, useMemo, useRef } from "react";
import { Terminal } from "@xterm/xterm";
import { SearchAddon } from "@xterm/addon-search";
import "@xterm/xterm/css/xterm.css";
function App() {
const terminalRef = useRef<HTMLDivElement>(null);
const xterm = useMemo(() => new Terminal({ allowProposedApi: true }), []);
const searchAddon = useMemo(() => new SearchAddon(), []);
useEffect(() => {
if (terminalRef.current && !xterm.element) {
xterm.loadAddon(searchAddon);
xterm.open(terminalRef.current);
for (let i = 0; i < 5; i++) {
xterm.writeln(
"1. hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello"
);
}
}
}, [xterm, searchAddon]);
useEffect(() => {
if (xterm.element) {
searchAddon.findNext("hello", {
caseSensitive: false,
wholeWord: false,
decorations: {
matchBackground: "#ffff00",
matchBorder: "#ffff00",
matchOverviewRuler: "#ffff00",
activeMatchBackground: "#ffff00",
activeMatchBorder: "#ffff00",
activeMatchColorOverviewRuler: "#ffff00",
},
incremental: false,
});
}
}, [searchAddon, xterm.element]);
return <div ref={terminalRef} />;
}
export default App;(this is somehow fixed in vscode by just not having the overflowing word in the results)
Reactions are currently unavailable