blessed
blessed copied to clipboard
Mouse listening interferes with `screen.exec`
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()
Hi,
Go the same problem. I found a hack by disabling the mouse before running the exec or spawn command and reenable it after. This the default behaviour I expected from "exec".
screen.program.clear();
screen.program.disableMouse();
screen.program.showCursor();
// run exec here
screen.program.enableMouse();
screen.program.hideCursor();
screen.render();