diff --git a/tabby-core/src/api/profileProvider.ts b/tabby-core/src/api/profileProvider.ts index 7f592720..7ea471b8 100644 --- a/tabby-core/src/api/profileProvider.ts +++ b/tabby-core/src/api/profileProvider.ts @@ -44,7 +44,7 @@ export abstract class ProfileProvider

{ abstract getBuiltinProfiles (): Promise[]> - abstract getNewTabParameters (profile: PartialProfile

): Promise> + abstract getNewTabParameters (profile: P): Promise> getSuggestedName (profile: PartialProfile

): string|null { return null diff --git a/tabby-local/src/profiles.ts b/tabby-local/src/profiles.ts index 07b02888..99e51f50 100644 --- a/tabby-local/src/profiles.ts +++ b/tabby-local/src/profiles.ts @@ -45,19 +45,17 @@ export class LocalProfilesService extends ProfileProvider { })) } - async getNewTabParameters (profile: PartialProfile): Promise> { + async getNewTabParameters (profile: LocalProfile): Promise> { profile = deepClone(profile) - if (!profile.options?.cwd) { + if (!profile.options.cwd) { if (this.app.activeTab instanceof TerminalTabComponent && this.app.activeTab.session) { - profile.options ??= {} profile.options.cwd = await this.app.activeTab.session.getWorkingDirectory() ?? undefined } if (this.app.activeTab instanceof SplitTabComponent) { const focusedTab = this.app.activeTab.getFocusedTab() if (focusedTab instanceof TerminalTabComponent && focusedTab.session) { - profile.options ??= {} profile.options.cwd = await focusedTab.session.getWorkingDirectory() ?? undefined } } diff --git a/tabby-ssh/src/profiles.ts b/tabby-ssh/src/profiles.ts index c9a5db8c..f412f60a 100644 --- a/tabby-ssh/src/profiles.ts +++ b/tabby-ssh/src/profiles.ts @@ -73,7 +73,7 @@ export class SSHProfilesService extends ProfileProvider { }] } - async getNewTabParameters (profile: PartialProfile): Promise> { + async getNewTabParameters (profile: SSHProfile): Promise> { return { type: SSHTabComponent, inputs: { profile }, diff --git a/tabby-ssh/src/services/ssh.service.ts b/tabby-ssh/src/services/ssh.service.ts index 0fcbbcb9..232cf4eb 100644 --- a/tabby-ssh/src/services/ssh.service.ts +++ b/tabby-ssh/src/services/ssh.service.ts @@ -28,8 +28,8 @@ export class SSHService { return this.detectedWinSCPPath ?? this.config.store.ssh.winSCPPath } - async getWinSCPURI (profile: SSHProfile, cwd?: string): Promise { - let uri = `scp://${profile.options.user}` + async getWinSCPURI (profile: SSHProfile, cwd?: string, username?: string): Promise { + let uri = `scp://${username ?? profile.options.user}` const password = await this.passwordStorage.loadPassword(profile) if (password) { uri += ':' + encodeURIComponent(password) @@ -43,7 +43,7 @@ export class SSHService { if (!path) { return } - const args = [await this.getWinSCPURI(session.profile)] + const args = [await this.getWinSCPURI(session.profile, undefined, session.authUsername ?? undefined)] if (session.activePrivateKey) { args.push('/privatekey') args.push(session.activePrivateKey) diff --git a/tabby-ssh/src/session/ssh.ts b/tabby-ssh/src/session/ssh.ts index ff36ae9d..16f53b57 100644 --- a/tabby-ssh/src/session/ssh.ts +++ b/tabby-ssh/src/session/ssh.ts @@ -56,12 +56,12 @@ export class SSHSession extends BaseSession { agentPath?: string activePrivateKey: string|null = null + authUsername: string|null = null private remainingAuthMethods: AuthMethod[] = [] private serviceMessage = new Subject() private keyboardInteractivePrompt = new Subject() private keychainPasswordUsed = false - private authUsername: string|null = null private passwordStorage: PasswordStorageService private ngbModal: NgbModal diff --git a/tabby-telnet/src/profiles.ts b/tabby-telnet/src/profiles.ts index 588b8eda..1455f076 100644 --- a/tabby-telnet/src/profiles.ts +++ b/tabby-telnet/src/profiles.ts @@ -55,7 +55,7 @@ export class TelnetProfilesService extends ProfileProvider { ] } - async getNewTabParameters (profile: PartialProfile): Promise> { + async getNewTabParameters (profile: TelnetProfile): Promise> { return { type: TelnetTabComponent, inputs: { profile },