mirror of
https://github.com/Eugeny/tabby
synced 2024-11-14 08:57:21 +00:00
Merge pull request #9307 from kimbob13/implicit-cr-lf
This commit is contained in:
commit
a4aa07c1f1
3 changed files with 16 additions and 1 deletions
|
@ -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 에이전트로 연결 유형 강제"
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
@ -133,7 +133,12 @@ export class TerminalStreamProcessor extends SessionMiddleware {
|
|||
private replaceNewlines (data: Buffer, mode?: NewlineMode): Buffer {
|
||||
if (!mode) {
|
||||
return data
|
||||
} else if (mode === 'implicit_cr') {
|
||||
return bufferReplace(data, '\n', '\r\n')
|
||||
} else if (mode === 'implicit_lf') {
|
||||
return bufferReplace(data, '\r', '\r\n')
|
||||
}
|
||||
|
||||
data = bufferReplace(data, '\r\n', '\n')
|
||||
data = bufferReplace(data, '\r', '\n')
|
||||
const replacement = {
|
||||
|
|
Loading…
Reference in a new issue