separate color schemes per profile - fixes #5885, fixes #4593, fixes #3516, fixes #7457, fixes #765

This commit is contained in:
Eugene Pankov
2023-02-04 19:51:16 +01:00
parent e0181973f7
commit 69d884e164
32 changed files with 192 additions and 106 deletions

View File

@@ -1,12 +1,12 @@
import stripAnsi from 'strip-ansi'
import { SerialPortStream } from '@serialport/stream'
import { LogService, NotificationsService, Profile } from 'tabby-core'
import { LogService, NotificationsService } from 'tabby-core'
import { Subject, Observable } from 'rxjs'
import { Injector, NgZone } from '@angular/core'
import { BaseSession, LoginScriptsOptions, SessionMiddleware, StreamProcessingOptions, TerminalStreamProcessor } from 'tabby-terminal'
import { BaseSession, BaseTerminalProfile, LoginScriptsOptions, SessionMiddleware, StreamProcessingOptions, TerminalStreamProcessor } from 'tabby-terminal'
import { SerialService } from './services/serial.service'
export interface SerialProfile extends Profile {
export interface SerialProfile extends BaseTerminalProfile {
options: SerialProfileOptions
}

View File

@@ -14,8 +14,7 @@ import { SerialSession, BAUD_RATES, SerialProfile } from '../api'
styles: [require('./serialTab.component.scss'), ...BaseTerminalTabComponent.styles],
animations: BaseTerminalTabComponent.animations,
})
export class SerialTabComponent extends BaseTerminalTabComponent {
profile?: SerialProfile
export class SerialTabComponent extends BaseTerminalTabComponent<SerialProfile> {
session: SerialSession|null = null
serialPort: any
Platform = Platform
@@ -56,16 +55,11 @@ export class SerialTabComponent extends BaseTerminalTabComponent {
super.ngOnInit()
setImmediate(() => {
this.setTitle(this.profile!.name)
this.setTitle(this.profile.name)
})
}
async initializeSession () {
if (!this.profile) {
this.logger.error('No serial profile info supplied')
return
}
const session = new SerialSession(this.injector, this.profile)
this.setSession(session)
@@ -121,6 +115,6 @@ export class SerialTabComponent extends BaseTerminalTabComponent {
})),
)
this.serialPort.update({ baudRate: rate })
this.profile!.options.baudrate = rate
this.profile.options.baudrate = rate
}
}