Skip to content

Greetings that use callback function runs multiple times #855

@jcubic

Description

@jcubic

Issue summary

When you use greetings as a function can call callback function. The greetings is rendered multiple times. 2 times on init and on every resize. Found by @leif in #853

Expected behavior

It should render once

Actual behavior

it renders multiple times

Steps to reproduce

Use this code:

const term = $('body').terminal({}, {
    greetings(cb) {
        cb(`This Terminal has ${this.cols()} cols`);
    }
});

Browser and OS

All

  • Write code
  • Write unit tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugresolvedif issue is resolved, it will be open until merge with master

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions