Compare commits

...

8 Commits

Author SHA1 Message Date
gh-log
424b062d5b scroll_terminal_by_line (#10353)
Co-authored-by: gh-log <>
2025-03-12 00:48:34 +01:00
Eugene
5deb725758 bumped russh again 2025-03-10 07:50:20 +01:00
Eugene
4069c22891 bumped russh for EXT_INFO race condition fix 2025-03-09 19:27:48 +01:00
mannjani
4a515d9432 Add support for %h and %r escape characters in IdentityFile for SSH. (#10343)
* Add support for %h and %r escape characters in IdentityFile for SSH.
See section "IdentityFile" on https://linux.die.net/man/5/ssh_config for
details.

* Fix lint warnings.
2025-03-05 09:28:31 +01:00
Eugene
b83b2e5acc Update README.ru-RU.md 2025-02-28 10:11:30 +01:00
Eugene
e407ee8bf1 fixed #9845, fixed #10302 - allow alternative OSC52 suffix 2025-02-25 00:40:28 +01:00
Eugene
c7b39bdca7 bump russh for 1024 bit rsa key support 2025-02-25 00:37:24 +01:00
ianaflous
934cdff0f8 Using ssh default profile(user/password/port) without host (#10076) 2025-02-25 00:14:27 +01:00
11 changed files with 66 additions and 21 deletions

View File

@@ -31,7 +31,7 @@
* Встроенный SSH- и Telnet-клиент и менеджер подключений;
* Встроенный последовательный терминал;
* Темы и цветовые схемы;
* Полностью настраеваемые сочетания клавиш;
* Полностью настраиваемые сочетания клавиш;
* Панели;
* Запоминание вкладок;
* Поддержка PowerShell (and PS Core), WSL, Git-Bash, Cygwin, MSYS2, Cmder и CMD;

View File

@@ -30,7 +30,7 @@
"native-process-working-directory": "^1.0.2",
"npm": "6",
"rxjs": "^7.5.7",
"russh": "0.1.21",
"russh": "0.1.24",
"source-map-support": "^0.5.20",
"v8-compile-cache": "^2.3.0",
"yargs": "^17.7.2"

View File

@@ -3628,10 +3628,10 @@ run-queue@^1.0.0, run-queue@^1.0.3:
dependencies:
aproba "^1.1.1"
russh@0.1.21:
version "0.1.21"
resolved "https://registry.yarnpkg.com/russh/-/russh-0.1.21.tgz#857b20c298a50a6657d1f1653ce9d149c68d6b5b"
integrity sha512-2zjOHTTDqaa3/pHUU+VCkoEqOXLpIpk9WATUaudtLGqy3n8Duz3WlhvyJzEmd+S+9eVGnQvyktpjtZziXLVHRA==
russh@0.1.24:
version "0.1.24"
resolved "https://registry.yarnpkg.com/russh/-/russh-0.1.24.tgz#dce27a3bc63eb78024db60e6767bc80cbf523b9a"
integrity sha512-lLMtXHJKL5uwRxwoFNDx71T7+qCXiL80qyGCRgQjYMV10gaW2AlI6mqcz3FVH8dXvdgK2ZE8DuSwlhCBK7schA==
dependencies:
"@napi-rs/cli" "^2.18.3"

View File

@@ -195,7 +195,13 @@ export class VaultService {
if (!vault) {
return null
}
return vault.secrets.find(s => s.type === type && this.keyMatches(key, s)) ?? null
let vaultSecret = vault.secrets.find(s => s.type === type && this.keyMatches(key, s))
if (!vaultSecret) {
// search for secret without host in vault (like a default user/password used in multiple servers)
key['host'] = null
vaultSecret = vault.secrets.find(s => s.type === type && this.keyMatches(key, s))
}
return vaultSecret ?? null
}
async addSecret (secret: VaultSecret): Promise<void> {

View File

@@ -162,9 +162,11 @@ export class SSHSession {
this.allAuthMethods = [{ type: 'none' }]
if (!this.profile.options.auth || this.profile.options.auth === 'publicKey') {
if (this.profile.options.privateKeys?.length) {
for (const pk of this.profile.options.privateKeys) {
for (let pk of this.profile.options.privateKeys) {
// eslint-disable-next-line @typescript-eslint/init-declarations
let contents: Buffer
pk = pk.replace('%h', this.profile.options.host)
pk = pk.replace('%r', this.profile.options.user)
try {
contents = await this.fileProviders.retrieveFile(pk)
} catch (error) {

View File

@@ -309,10 +309,16 @@ export class BaseTerminalTabComponent<P extends BaseTerminalProfile> extends Bas
case 'scroll-to-top':
this.frontend?.scrollToTop()
break
case 'scroll-up':
case 'scroll-page-up':
this.frontend?.scrollPages(-1)
break
case 'scroll-up':
this.frontend?.scrollLines(-1)
break
case 'scroll-down':
this.frontend?.scrollLines(1)
break
case 'scroll-page-down':
this.frontend?.scrollPages(1)
break
case 'scroll-to-bottom':

View File

@@ -101,8 +101,10 @@ export class TerminalConfigProvider extends ConfigProvider {
'⌘-⌥-Shift-I',
],
'scroll-to-top': ['Shift-PageUp'],
'scroll-up': ['⌥-PageUp'],
'scroll-down': ['⌥-PageDown'],
'scroll-page-up': ['⌥-PageUp'],
'scroll-up': ['Ctrl-Shift-Up'],
'scroll-down': ['Ctrl-Shift-Down'],
'scroll-page-down': ['⌥-PageDown'],
'scroll-to-bottom': ['Shift-PageDown'],
},
},
@@ -152,8 +154,10 @@ export class TerminalConfigProvider extends ConfigProvider {
'Ctrl-Alt-Shift-I',
],
'scroll-to-top': ['Ctrl-PageUp'],
'scroll-up': ['Alt-PageUp'],
'scroll-down': ['Alt-PageDown'],
'scroll-page-up': ['Alt-PageUp'],
'scroll-up': ['Ctrl-Shift-Up'],
'scroll-down': ['Ctrl-Shift-Down'],
'scroll-page-down': ['Alt-PageDown'],
'scroll-to-bottom': ['Ctrl-PageDown'],
},
},
@@ -201,8 +205,10 @@ export class TerminalConfigProvider extends ConfigProvider {
'Ctrl-Alt-Shift-I',
],
'scroll-to-top': ['Ctrl-PageUp'],
'scroll-up': ['Alt-PageUp'],
'scroll-down': ['Alt-PageDown'],
'scroll-page-up': ['Alt-PageUp'],
'scroll-up': ['Ctrl-Shift-Up'],
'scroll-down': ['Ctrl-Shift-Down'],
'scroll-page-down': ['Alt-PageDown'],
'scroll-to-bottom': ['Ctrl-PageDown'],
},
},

View File

@@ -77,6 +77,7 @@ export abstract class Frontend {
abstract visualBell (): void
abstract scrollToTop (): void
abstract scrollLines (amount: number): void
abstract scrollPages (pages: number): void
abstract scrollToBottom (): void

View File

@@ -357,6 +357,10 @@ export class XTermFrontend extends Frontend {
this.xterm.scrollPages(pages)
}
scrollLines (amount: number): void {
this.xterm.scrollLines(amount)
}
scrollToBottom (): void {
this.xtermCore._scrollToBottom()
}

View File

@@ -86,11 +86,19 @@ export class TerminalHotkeyProvider extends HotkeyProvider {
name: this.translate.instant('Scroll terminal to top'),
},
{
id: 'scroll-up',
id: 'scroll-page-up',
name: this.translate.instant('Scroll terminal one page up'),
},
{
id: 'scroll-up',
name: this.translate.instant('Scroll terminal one line up'),
},
{
id: 'scroll-down',
name: this.translate.instant('Scroll terminal one line down'),
},
{
id: 'scroll-page-down',
name: this.translate.instant('Scroll terminal one page down'),
},
{
@@ -113,3 +121,4 @@ export class TerminalHotkeyProvider extends HotkeyProvider {
return this.hotkeys
}
}

View File

@@ -3,7 +3,7 @@ import { Subject, Observable } from 'rxjs'
import { SessionMiddleware } from '../api/middleware'
const OSCPrefix = Buffer.from('\x1b]')
const OSCSuffix = Buffer.from('\x07')
const OSCSuffixes = [Buffer.from('\x07'), Buffer.from('\x1b\\')]
export class OSCProcessor extends SessionMiddleware {
get cwdReported$ (): Observable<string> { return this.cwdReported }
@@ -14,11 +14,22 @@ export class OSCProcessor extends SessionMiddleware {
feedFromSession (data: Buffer): void {
let startIndex = 0
while (data.includes(OSCPrefix, startIndex) && data.includes(OSCSuffix, startIndex)) {
const params = data.subarray(data.indexOf(OSCPrefix, startIndex) + OSCPrefix.length)
const oscString = params.subarray(0, params.indexOf(OSCSuffix)).toString()
while (data.includes(OSCPrefix, startIndex)) {
const si = startIndex
if (!OSCSuffixes.some(s => data.includes(s, si))) {
break
}
startIndex = data.indexOf(OSCSuffix, startIndex) + OSCSuffix.length
const params = data.subarray(data.indexOf(OSCPrefix, startIndex) + OSCPrefix.length)
const [closesSuffix, closestSuffixIndex] = OSCSuffixes
.map((suffix): [Buffer, number] => [suffix, params.indexOf(suffix)])
.filter(([_, index]) => index !== -1)
.sort(([_, a], [__, b]) => a - b)[0]
const oscString = params.subarray(0, closestSuffixIndex).toString()
startIndex = data.indexOf(closesSuffix, startIndex) + closesSuffix.length
const [oscCodeString, ...oscParams] = oscString.split(';')
const oscCode = parseInt(oscCodeString)