Merge branch 'master' into feature/sidetab

This commit is contained in:
Eugene
2020-12-06 18:21:03 +01:00
committed by GitHub
17 changed files with 117 additions and 33 deletions

View File

@@ -156,16 +156,28 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
this.resetZoom()
break
case 'previous-word':
this.sendInput('\x1bb')
this.sendInput({
[Platform.Windows]: '\x1b[1;5D',
[Platform.macOS]: '\x1bb',
[Platform.Linux]: '\x1bb',
}[this.hostApp.platform])
break
case 'next-word':
this.sendInput('\x1bf')
this.sendInput({
[Platform.Windows]: '\x1b[1;5C',
[Platform.macOS]: '\x1bf',
[Platform.Linux]: '\x1bf',
}[this.hostApp.platform])
break
case 'delete-previous-word':
this.sendInput('\x1b\x7f')
break
case 'delete-next-word':
this.sendInput('\x1bd')
this.sendInput({
[Platform.Windows]: '\x1bd\x1b[3;5~',
[Platform.macOS]: '\x1bd',
[Platform.Linux]: '\x1bd',
}[this.hostApp.platform])
break
case 'search':
this.showSearchPanel = true

View File

@@ -109,6 +109,24 @@ h3.mb-3 Appearance
(ngModelChange)='config.save()',
)
.form-line
.header
.title Hide tab index
toggle(
[(ngModel)]='config.store.terminal.hideTabIndex',
(ngModelChange)='config.save();',
)
.form-line
.header
.title Hide tab close button
toggle(
[(ngModel)]='config.store.terminal.hideCloseButton',
(ngModelChange)='config.save();',
)
.form-line
.header
.title Fallback font

View File

@@ -26,7 +26,7 @@ button.btn.btn-link(
.mr-2
button.btn.btn-link(
(click)='options.caseSensitive = !options.caseSensitive',
(click)='options.caseSensitive = !options.caseSensitive; saveSearchOptions()',
[class.active]='options.caseSensitive',
ngbTooltip='Case sensitivity',
placement='bottom'
@@ -34,14 +34,14 @@ button.btn.btn-link(
i.fa.fa-fw.fa-font
button.btn.btn-link(
(click)='options.regex = !options.regex',
(click)='options.regex = !options.regex; saveSearchOptions()',
[class.active]='options.regex',
ngbTooltip='Regular expression',
placement='bottom'
)
i.fa.fa-fw.fa-asterisk
button.btn.btn-link(
(click)='options.wholeWord = !options.wholeWord',
(click)='options.wholeWord = !options.wholeWord; saveSearchOptions()',
[class.active]='options.wholeWord',
ngbTooltip='Whole word',
placement='bottom'

View File

@@ -1,6 +1,7 @@
import { Component, Input, Output, EventEmitter } from '@angular/core'
import { ToastrService } from 'ngx-toastr'
import { Frontend, SearchOptions } from '../frontends/frontend'
import { ConfigService } from 'terminus-core'
@Component({
selector: 'search-panel',
@@ -13,12 +14,14 @@ export class SearchPanelComponent {
notFound = false
options: SearchOptions = {
incremental: true,
...this.config.store.terminal.searchOptions,
}
@Output() close = new EventEmitter()
constructor (
private toastr: ToastrService,
public config: ConfigService,
) { }
onQueryChange (): void {
@@ -45,4 +48,12 @@ export class SearchPanelComponent {
this.toastr.error('Not found')
}
}
saveSearchOptions (): void {
this.config.store.terminal.searchOptions.regex = this.options.regex
this.config.store.terminal.searchOptions.caseSensitive = this.options.caseSensitive
this.config.store.terminal.searchOptions.wholeWord = this.options.wholeWord
this.config.save()
}
}

View File

@@ -116,7 +116,7 @@ h3.mb-3 Terminal
[(ngModel)]='config.store.terminal.scrollOnInput',
(ngModelChange)='config.save()',
)
.form-line
.header
.title Use Alt key as the Meta key

View File

@@ -23,6 +23,8 @@ export class TerminalConfigProvider extends ConfigProvider {
ligatures: false,
cursor: 'block',
cursorBlink: true,
hideTabIndex: false,
hideCloseButton: false,
customShell: '',
rightClick: 'menu',
pasteOnMiddleClick: true,
@@ -65,6 +67,12 @@ export class TerminalConfigProvider extends ConfigProvider {
recoverTabs: true,
warnOnMultilinePaste: true,
showDefaultProfiles: true,
searchRegexAlwaysEnabled: false,
searchOptions: {
regex: false,
wholeWord: false,
caseSensitive: false,
},
},
}