diff --git a/tabby-serial/src/api.ts b/tabby-serial/src/api.ts index 84b992e5..7fba2306 100644 --- a/tabby-serial/src/api.ts +++ b/tabby-serial/src/api.ts @@ -20,6 +20,7 @@ export interface SerialProfileOptions extends StreamProcessingOptions, LoginScri xon?: boolean xoff?: boolean xany?: boolean + slowSend?: boolean } export const BAUD_RATES = [ @@ -123,7 +124,13 @@ export class SerialSession extends BaseSession { } write (data: Buffer): void { - this.streamProcessor.feedFromTerminal(data) + if (!this.profile.options.slowSend) { + this.streamProcessor.feedFromTerminal(data) + } else { + for (const byte of data) { + this.streamProcessor.feedFromTerminal(Buffer.from([byte])) + } + } } async destroy (): Promise { diff --git a/tabby-serial/src/components/serialProfileSettings.component.pug b/tabby-serial/src/components/serialProfileSettings.component.pug index cd7d86d1..60a79259 100644 --- a/tabby-serial/src/components/serialProfileSettings.component.pug +++ b/tabby-serial/src/components/serialProfileSettings.component.pug @@ -77,6 +77,12 @@ ul.nav-tabs(ngbNav, #nav='ngbNav') .title Xany toggle([(ngModel)]='profile.options.xany') + .form-line + .header + .title Slow feed + .description Sends data one byte at a time + toggle([(ngModel)]='profile.options.slowFeed') + li(ngbNavItem) a(ngbNavLink) Login scripts ng-template(ngbNavContent) diff --git a/tabby-serial/src/profiles.ts b/tabby-serial/src/profiles.ts index e83ce488..d32e1d53 100644 --- a/tabby-serial/src/profiles.ts +++ b/tabby-serial/src/profiles.ts @@ -30,6 +30,7 @@ export class SerialProfilesService extends ProfileProvider { inputNewlines: null, outputNewlines: null, scripts: [], + slowSend: false, }, }