mirror of
https://github.com/Eugeny/tabby.git
synced 2025-08-21 16:51:52 +00:00
store Screen configuration in Terminus user directory (fixes #177)
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
import * as fs from 'mz/fs'
|
import * as fs from 'mz/fs'
|
||||||
|
import * as path from 'path'
|
||||||
import { exec, spawn } from 'mz/child_process'
|
import { exec, spawn } from 'mz/child_process'
|
||||||
import { exec as execAsync, execFileSync } from 'child_process'
|
import { exec as execAsync, execFileSync } from 'child_process'
|
||||||
|
|
||||||
import { AsyncSubject } from 'rxjs'
|
import { AsyncSubject } from 'rxjs'
|
||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { Logger, LogService } from 'terminus-core'
|
import { Logger, LogService, ElectronService } from 'terminus-core'
|
||||||
import { SessionOptions, SessionPersistenceProvider } from '../api'
|
import { SessionOptions, SessionPersistenceProvider } from '../api'
|
||||||
|
|
||||||
declare function delay (ms: number): Promise<void>
|
declare function delay (ms: number): Promise<void>
|
||||||
@@ -35,6 +36,7 @@ export class ScreenPersistenceProvider extends SessionPersistenceProvider {
|
|||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
log: LogService,
|
log: LogService,
|
||||||
|
private electron: ElectronService,
|
||||||
) {
|
) {
|
||||||
super()
|
super()
|
||||||
this.logger = log.create('main')
|
this.logger = log.create('main')
|
||||||
@@ -115,7 +117,7 @@ export class ScreenPersistenceProvider extends SessionPersistenceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async prepareConfig (): Promise<string> {
|
private async prepareConfig (): Promise<string> {
|
||||||
let configPath = '/tmp/.termScreenConfig'
|
let configPath = path.join(this.electron.app.getPath('userData'), 'screen-config.tmp')
|
||||||
await fs.writeFile(configPath, `
|
await fs.writeFile(configPath, `
|
||||||
escape ^^^
|
escape ^^^
|
||||||
vbell off
|
vbell off
|
||||||
|
Reference in New Issue
Block a user