mirror of
https://github.com/Eugeny/tabby.git
synced 2025-09-12 11:24:36 +00:00
added a telnet client - fixes #760
This commit is contained in:
@@ -7,7 +7,7 @@ import { debounce } from 'rxjs/operators'
|
||||
import { PassThrough, Readable, Writable } from 'stream'
|
||||
import { ReadLine, createInterface as createReadline, clearLine } from 'readline'
|
||||
|
||||
export type InputMode = null | 'readline' | 'readline-hex' // eslint-disable-line @typescript-eslint/no-type-alias
|
||||
export type InputMode = null | 'local-echo' | 'readline' | 'readline-hex' // eslint-disable-line @typescript-eslint/no-type-alias
|
||||
export type OutputMode = null | 'hex' // eslint-disable-line @typescript-eslint/no-type-alias
|
||||
export type NewlineMode = null | 'cr' | 'lf' | 'crlf' // eslint-disable-line @typescript-eslint/no-type-alias
|
||||
|
||||
@@ -76,6 +76,9 @@ export class TerminalStreamProcessor {
|
||||
}
|
||||
|
||||
feedFromTerminal (data: Buffer): void {
|
||||
if (this.options.inputMode === 'local-echo') {
|
||||
this.outputToTerminal.next(this.replaceNewlines(data, 'crlf'))
|
||||
}
|
||||
if (this.options.inputMode?.startsWith('readline')) {
|
||||
this.inputReadlineInStream.write(data)
|
||||
} else {
|
||||
|
@@ -12,6 +12,7 @@ export class StreamProcessingSettingsComponent {
|
||||
|
||||
inputModes = [
|
||||
{ key: null, name: 'Normal', description: 'Input is sent as you type' },
|
||||
{ key: 'local-echo', name: 'Local echo', description: 'Immediately echoes your input locally' },
|
||||
{ key: 'readline', name: 'Line by line', description: 'Line editor, input is sent after you press Enter' },
|
||||
{ key: 'readline-hex', name: 'Hexadecimal', description: 'Send bytes by typing in hex values' },
|
||||
]
|
||||
|
@@ -42,12 +42,12 @@ export abstract class BaseSession {
|
||||
this.open = false
|
||||
this.closed.next()
|
||||
this.destroyed.next()
|
||||
this.closed.complete()
|
||||
this.destroyed.complete()
|
||||
this.output.complete()
|
||||
this.binaryOutput.complete()
|
||||
await this.gracefullyKillProcess()
|
||||
}
|
||||
this.closed.complete()
|
||||
this.destroyed.complete()
|
||||
this.output.complete()
|
||||
this.binaryOutput.complete()
|
||||
}
|
||||
|
||||
abstract start (options: unknown): void
|
||||
|
Reference in New Issue
Block a user