mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-27 02:08:34 +00:00
allow specifying a custom startup directory (fixes #223)
This commit is contained in:
@@ -247,6 +247,15 @@
|
|||||||
(ngModelChange)='config.save()',
|
(ngModelChange)='config.save()',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
.form-group
|
||||||
|
label Working directory
|
||||||
|
input.form-control(
|
||||||
|
type='text',
|
||||||
|
placeholder='Home directory',
|
||||||
|
'[(ngModel)]'='config.store.terminal.workingDirectory',
|
||||||
|
(ngModelChange)='config.save()',
|
||||||
|
)
|
||||||
|
|
||||||
.d-flex
|
.d-flex
|
||||||
.form-group.mr-3
|
.form-group.mr-3
|
||||||
label Terminal bell
|
label Terminal bell
|
||||||
@@ -301,37 +310,38 @@
|
|||||||
)
|
)
|
||||||
| On
|
| On
|
||||||
|
|
||||||
.form-group
|
.d-flex
|
||||||
label Session persistence
|
.form-group.mr-3(*ngIf='persistenceProviders.length > 0')
|
||||||
select.form-control(
|
label Session persistence
|
||||||
'[(ngModel)]'='config.store.terminal.persistence',
|
select.form-control(
|
||||||
(ngModelChange)='config.save()',
|
'[(ngModel)]'='config.store.terminal.persistence',
|
||||||
)
|
(ngModelChange)='config.save()',
|
||||||
option([ngValue]='null') Off
|
)
|
||||||
option(
|
option([ngValue]='null') Off
|
||||||
*ngFor='let provider of persistenceProviders',
|
option(
|
||||||
[ngValue]='provider.id'
|
*ngFor='let provider of persistenceProviders',
|
||||||
) {{provider.displayName}}
|
[ngValue]='provider.id'
|
||||||
|
) {{provider.displayName}}
|
||||||
|
|
||||||
.form-group
|
.form-group
|
||||||
label Auto-open a terminal on app start
|
label Auto-open a terminal on app start
|
||||||
br
|
br
|
||||||
.btn-group(
|
.btn-group(
|
||||||
'[(ngModel)]'='config.store.terminal.autoOpen',
|
'[(ngModel)]'='config.store.terminal.autoOpen',
|
||||||
(ngModelChange)='config.save()',
|
(ngModelChange)='config.save()',
|
||||||
ngbRadioGroup
|
ngbRadioGroup
|
||||||
)
|
)
|
||||||
label.btn.btn-secondary(ngbButtonLabel)
|
label.btn.btn-secondary(ngbButtonLabel)
|
||||||
input(
|
input(
|
||||||
type='radio',
|
type='radio',
|
||||||
ngbButton,
|
ngbButton,
|
||||||
[value]='false'
|
[value]='false'
|
||||||
)
|
)
|
||||||
| Off
|
| Off
|
||||||
label.btn.btn-secondary(ngbButtonLabel)
|
label.btn.btn-secondary(ngbButtonLabel)
|
||||||
input(
|
input(
|
||||||
type='radio',
|
type='radio',
|
||||||
ngbButton,
|
ngbButton,
|
||||||
[value]='true'
|
[value]='true'
|
||||||
)
|
)
|
||||||
| On
|
| On
|
||||||
|
@@ -13,6 +13,7 @@ export class TerminalConfigProvider extends ConfigProvider {
|
|||||||
cursor: 'block',
|
cursor: 'block',
|
||||||
cursorBlink: true,
|
cursorBlink: true,
|
||||||
customShell: '',
|
customShell: '',
|
||||||
|
workingDirectory: '',
|
||||||
colorScheme: {
|
colorScheme: {
|
||||||
__nonStructural: true,
|
__nonStructural: true,
|
||||||
name: 'Material',
|
name: 'Material',
|
||||||
|
@@ -33,8 +33,12 @@ export class TerminalService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async openTab (shell?: IShell, cwd?: string): Promise<TerminalTabComponent> {
|
async openTab (shell?: IShell, cwd?: string): Promise<TerminalTabComponent> {
|
||||||
if (!cwd && this.app.activeTab instanceof TerminalTabComponent) {
|
if (!cwd) {
|
||||||
cwd = await this.app.activeTab.session.getWorkingDirectory()
|
if (this.app.activeTab instanceof TerminalTabComponent) {
|
||||||
|
cwd = await this.app.activeTab.session.getWorkingDirectory()
|
||||||
|
} else {
|
||||||
|
cwd = this.config.store.terminal.workingDirectory || null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!shell) {
|
if (!shell) {
|
||||||
let shells = await this.shells$.toPromise()
|
let shells = await this.shells$.toPromise()
|
||||||
|
@@ -25,7 +25,10 @@ export class WSLShellProvider extends ShellProvider {
|
|||||||
return [{
|
return [{
|
||||||
id: 'wsl',
|
id: 'wsl',
|
||||||
name: 'Bash on Windows',
|
name: 'Bash on Windows',
|
||||||
command: wslPath
|
command: wslPath,
|
||||||
|
env: {
|
||||||
|
TERM: 'xterm-color',
|
||||||
|
}
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user