Skip to content

Commit

Permalink
fix: xterm copy-out logic is erratic with line wrapping
Browse files Browse the repository at this point in the history
when capturing the output of the pty, line wrapping causes odd behavior, with lines squashed together strangely
  • Loading branch information
starpit committed Jun 17, 2022
1 parent 766053e commit 6f3c1bc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/plugin-bash-like/src/pty/copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ export default function copy(terminal: Terminal): XtermResponse['rows'] {
const current = terminal.buffer.active.getNullCell()

const nLines = lastFullLineIdx(terminal, current) + 1
let prevRow: XtermResponseCell[]
for (let idx = 0; idx < nLines; idx++) {
const line = terminal.buffer.active.getLine(idx)
let prevRow: XtermResponseCell[] = undefined // eslint-disable-line
for (let ridx = 0; ridx < nLines; ridx++) {
const line = terminal.buffer.active.getLine(ridx)

if (line.isWrapped && prevRow !== undefined) {
squashRow(line, previous, current, prevRow)
Expand Down

0 comments on commit 6f3c1bc

Please # to comment.