Mouse listening interferes with `screen.exec`
Author: gjuchaultCreated Oct 14, 2018Updated Sep 10, 2024
Hello,
If one of the component has mouse supports, it calls screen._listenMouse, which register events on mouse actions.
Theses are not cleared before screen.exec, which results in characters being written in the executed.
Example: if you press b to get the bash input and try scrolling or moving the mouse, the bash input will be filled with characters.
const blessed = require('blessed')
const screen = blessed.screen({
autoPadding: true,
smartCSR: true,
title: 'kitermatic'
})
const box = blessed.box({
content: 'hello'.repeat(30),
scrollable: true,
mouse: true,
top: '0%+5',
left: '30%',
height: '20%',
interactive: true,
alwaysScroll: true,
width: '30%',
border: { type: 'line' },
onClick() {
screen.exec('bash')
}
})
screen.append(box)
screen.key('b', () => screen.exec('bash'))
screen.key(['escape', 'q', 'C-c'], () => process.exit(0))
screen.render()Source: chjj/blessed