1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-09-20 09:27:16 +03:00
This commit is contained in:
Eugene Pankov 2020-12-27 21:03:12 +01:00
parent 10ae6ffd99
commit bc7a537c4c
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4
13 changed files with 21 additions and 22 deletions

View File

@ -111,7 +111,6 @@ rules:
'@typescript-eslint/lines-between-class-members':
- error
- exceptAfterSingleLine: true
'@typescript-eslint/non-nullable-type-assertion-style': off
'@typescript-eslint/dot-notation': off
'@typescript-eslint/no-confusing-void-expression': off
'@typescript-eslint/no-implicit-any-catch': off

View File

@ -173,8 +173,8 @@ export async function loadPlugins (foundPlugins: PluginInfo[], progress: Progres
console.time(label)
const packageModule = nodeRequire(foundPlugin.path)
const pluginModule = packageModule.default.forRoot ? packageModule.default.forRoot() : packageModule.default
pluginModule['pluginName'] = foundPlugin.name
pluginModule['bootstrap'] = packageModule.bootstrap
pluginModule.pluginName = foundPlugin.name
pluginModule.bootstrap = packageModule.bootstrap
plugins.push(pluginModule)
console.timeEnd(label)
await new Promise(x => setTimeout(x, 50))

View File

@ -194,10 +194,10 @@ export class ConfigService {
this.servicesCache = {}
const ngModule = window['rootModule'].ɵinj
for (const imp of ngModule.imports) {
const module = imp['ngModule'] || imp
const module = imp.ngModule || imp
if (module.ɵinj?.providers) {
this.servicesCache[module['pluginName']] = module.ɵinj.providers.map(provider => {
return provider['useClass'] || provider
this.servicesCache[module.pluginName] = module.ɵinj.providers.map(provider => {
return provider.useClass || provider
})
}
}

View File

@ -44,7 +44,7 @@ export class ShellIntegrationService {
'extras',
'automator-workflows',
)
this.automatorWorkflowsDestination = path.join(process.env.HOME as string, 'Library', 'Services')
this.automatorWorkflowsDestination = path.join(process.env.HOME!, 'Library', 'Services')
}
this.updatePaths()
}

View File

@ -11,8 +11,8 @@ export class RecoveryProvider extends TabRecoveryProvider {
return {
type: SerialTabComponent,
options: {
connection: recoveryToken['connection'],
savedState: recoveryToken['savedState'],
connection: recoveryToken.connection,
savedState: recoveryToken.savedState,
},
}
}

View File

@ -143,7 +143,7 @@ export class SettingsTabComponent extends BaseTabComponent {
hotkeyFilterFn (hotkey: HotkeyDescription, query: string): boolean {
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
const s = hotkey.name + (this.getHotkey(hotkey.id) || []).toString() as string
const s = hotkey.name + (this.getHotkey(hotkey.id) || []).toString()
return s.toLowerCase().includes(query.toLowerCase())
}
}

View File

@ -57,7 +57,7 @@ export class SSHService {
let privateKeyPath = session.connection.privateKey
if (!privateKeyPath) {
const userKeyPath = path.join(process.env.HOME as string, '.ssh', 'id_rsa')
const userKeyPath = path.join(process.env.HOME!, '.ssh', 'id_rsa')
if (await fs.exists(userKeyPath)) {
logCallback?.('Using user\'s default private key')
privateKeyPath = userKeyPath
@ -219,7 +219,7 @@ export class SSHService {
}
}
} else {
agent = process.env.SSH_AUTH_SOCK as string
agent = process.env.SSH_AUTH_SOCK!
}
const authMethodsLeft = ['none']

View File

@ -319,7 +319,7 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
}
async paste (): Promise<void> {
let data = this.electron.clipboard.readText() as string
let data = this.electron.clipboard.readText()
if (this.config.store.terminal.bracketedPaste) {
data = '\x1b[200~' + data + '\x1b[201~'
}

View File

@ -8,7 +8,7 @@ import { TerminalColorScheme } from './api/interfaces'
@Injectable()
export class HyperColorSchemes extends TerminalColorSchemeProvider {
async getSchemes (): Promise<TerminalColorScheme[]> {
const pluginsPath = path.join(process.env.HOME as string, '.hyper_plugins', 'node_modules')
const pluginsPath = path.join(process.env.HOME!, '.hyper_plugins', 'node_modules')
if (!await fs.exists(pluginsPath)) {
return []
}

View File

@ -153,8 +153,8 @@ export class XTermFrontend extends Frontend {
host.addEventListener('dragOver', (event: any) => this.dragOver.next(event))
host.addEventListener('drop', event => this.drop.next(event))
host.addEventListener('mousedown', event => this.mouseEvent.next(event as MouseEvent))
host.addEventListener('mouseup', event => this.mouseEvent.next(event as MouseEvent))
host.addEventListener('mousedown', event => this.mouseEvent.next(event))
host.addEventListener('mouseup', event => this.mouseEvent.next(event))
host.addEventListener('mousewheel', event => this.mouseEvent.next(event as MouseEvent))
const ro = new window['ResizeObserver'](() => setTimeout(() => this.resizeHandler()))

View File

@ -11,8 +11,8 @@ export class RecoveryProvider extends TabRecoveryProvider {
return {
type: TerminalTabComponent,
options: {
sessionOptions: recoveryToken['sessionOptions'],
savedState: recoveryToken['savedState'],
sessionOptions: recoveryToken.sessionOptions,
savedState: recoveryToken.savedState,
},
}
}

View File

@ -72,7 +72,7 @@ export class WSLShellProvider extends ShellProvider {
return [{
id: 'wsl',
name: 'WSL / Bash on Windows',
icon: wslIconMap['Linux'],
icon: wslIconMap.Linux,
command: bashPath,
env: {
TERM: 'xterm-color',

View File

@ -107,7 +107,7 @@ export class NewTabContextMenu extends TabContextMenuItemProvider {
label: 'Duplicate as administrator',
click: () => this.zone.run(async () => {
this.terminalService.openTabWithOptions({
...(tab as TerminalTabComponent).sessionOptions,
...tab.sessionOptions,
runAsAdministrator: true,
})
}),
@ -150,7 +150,7 @@ export class CopyPasteContextMenu extends TabContextMenuItemProvider {
click: (): void => {
this.zone.run(() => {
setTimeout(() => {
(tab as BaseTerminalTabComponent).frontend.copySelection()
tab.frontend.copySelection()
this.toastr.info('Copied')
})
})
@ -159,7 +159,7 @@ export class CopyPasteContextMenu extends TabContextMenuItemProvider {
{
label: 'Paste',
click: (): void => {
this.zone.run(() => (tab as BaseTerminalTabComponent).paste())
this.zone.run(() => tab.paste())
},
},
]