Skip to content

Property 'on' does not exist on type 'ITerminal' #105

@rollandjb

Description

@rollandjb

I tried putting the code below adapted form the fork example in a typescript file. I get a compiler error:

Property 'on' does not exist on type 'ITerminal'

I wanted to try this out in a node app. I notice that on is declared on the Terminal class in lib/terminal.d.ts. Is there some Typescript configuration I need to make this work?

import * as pty from 'node-pty'

const term = pty.spawn('bash', [], {
    name: 'xterm-color',
    cols: 80,
    rows: 30,
    cwd: process.env.HOME,
    // env: process.env || {}
});

term.on('data', function (data) {
    console.log(data);
});

term.write('ls\r');
term.resize(100, 40);
term.write('ls\r');

setTimeout(term.kill.bind(term), 5000);

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions