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 86663ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/plugin-bash-like/src/pty/copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ export default function copy(terminal: Terminal): XtermResponse['rows'] {

const nLines = lastFullLineIdx(terminal, current) + 1
let prevRow: XtermResponseCell[]
for (let idx = 0; idx < nLines; idx++) {
const line = terminal.buffer.active.getLine(idx)
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 86663ea

Please # to comment.