Skip to content

Commit

Permalink
add implicit cr and implicit lf for serial terminal similar to putty
Browse files Browse the repository at this point in the history
  • Loading branch information
kimbob13 committed Dec 6, 2023
1 parent 2dc64ae commit a8ef596
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
8 changes: 8 additions & 0 deletions locale/ko-KR.po
Expand Up @@ -916,6 +916,14 @@ msgstr "CRLF 강제"
msgid "Force LF"
msgstr "LF 강제"

#: tabby-terminal/src/components/streamProcessingSettings.component.ts:56
msgid "Implicit CR in every LF"
msgstr "LF에만 CR 추가"

#: tabby-terminal/src/components/streamProcessingSettings.component.ts:57
msgid "Implicit LF in every CR"
msgstr "CR에만 LF 추가"

#: locale/tmp-html/tabby-ssh/src/components/sshSettingsTab.component.html:25
msgid "Forces a specific SSH agent connection type."
msgstr "특정 SSH 에이전트로 연결 유형 강제"
Expand Down
Expand Up @@ -53,6 +53,8 @@ export class StreamProcessingSettingsComponent {
{ key: 'cr', name: _('Force CR') },
{ key: 'lf', name: _('Force LF') },
{ key: 'crlf', name: _('Force CRLF') },
{ key: 'implicit_cr', name: _('Implicit CR in every LF') },
{ key: 'implicit_lf', name: _('Implicit LF in every CR') },
]

getInputModeName (key) {
Expand Down
9 changes: 8 additions & 1 deletion tabby-terminal/src/middleware/streamProcessing.ts
Expand Up @@ -9,7 +9,7 @@ import { SessionMiddleware } from '../api/middleware'

export type InputMode = null | 'local-echo' | 'readline' | 'readline-hex'
export type OutputMode = null | 'hex'
export type NewlineMode = null | 'cr' | 'lf' | 'crlf'
export type NewlineMode = null | 'cr' | 'lf' | 'crlf' | 'implicit_cr' | 'implicit_lf'

export interface StreamProcessingOptions {
inputMode?: InputMode
Expand Down Expand Up @@ -134,6 +134,13 @@ export class TerminalStreamProcessor extends SessionMiddleware {
if (!mode) {
return data
}

Check failure on line 136 in tabby-terminal/src/middleware/streamProcessing.ts

View workflow job for this annotation

GitHub Actions / Lint

Closing curly brace does not appear on the same line as the subsequent block
else if (mode == 'implicit_cr') {

Check failure on line 137 in tabby-terminal/src/middleware/streamProcessing.ts

View workflow job for this annotation

GitHub Actions / Lint

Expected '===' and instead saw '=='
return bufferReplace(data, '\n', '\r\n')
}

Check failure on line 139 in tabby-terminal/src/middleware/streamProcessing.ts

View workflow job for this annotation

GitHub Actions / Lint

Closing curly brace does not appear on the same line as the subsequent block
else if (mode == 'implicit_lf') {

Check failure on line 140 in tabby-terminal/src/middleware/streamProcessing.ts

View workflow job for this annotation

GitHub Actions / Lint

Expected '===' and instead saw '=='
return bufferReplace(data, '\r', '\r\n')
}

data = bufferReplace(data, '\r\n', '\n')
data = bufferReplace(data, '\r', '\n')
const replacement = {
Expand Down

0 comments on commit a8ef596

Please sign in to comment.