Compare commits

...

5 Commits

Author SHA1 Message Date
Eugene Pankov
980834df6f macOS UTF8 fixes fixed #31, fixed #40 2017-07-08 11:30:25 +02:00
Eugene Pankov
50968508df fixed cwd detection on el capitan (fixes #63) 2017-07-06 10:37:52 +02:00
Eugene Pankov
8ee93297be properly display Space in hotkeys (fixes #76) 2017-07-06 10:28:33 +02:00
Eugene Pankov
dc9b2553ae Merge branch 'master' of github.com:Eugeny/terminus 2017-07-06 10:28:31 +02:00
Eugene Pankov
9834b27b8d bump 2017-07-05 16:24:03 +02:00
9 changed files with 29 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "terminus-community-color-schemes", "name": "terminus-community-color-schemes",
"version": "1.0.0-alpha.14.3", "version": "1.0.0-alpha.16-8-gfc060ac",
"description": "Community color schemes for Terminus", "description": "Community color schemes for Terminus",
"keywords": [ "keywords": [
"terminus-plugin" "terminus-plugin"

View File

@@ -1,6 +1,6 @@
{ {
"name": "terminus-core", "name": "terminus-core",
"version": "1.0.0-alpha.14", "version": "1.0.0-alpha.16-8-gfc060ac",
"description": "Terminus core", "description": "Terminus core",
"keywords": [ "keywords": [
"terminus-plugin" "terminus-plugin"

View File

@@ -45,7 +45,9 @@ export function stringifyKeySequence (events: NativeKeyEvent[]): string[] {
// TODO make this optional? // TODO make this optional?
continue continue
} }
if (event.key.length === 1) { if (event.key === ' ') {
itemKeys.push('Space')
} else if (event.key.length === 1) {
itemKeys.push(event.key.toUpperCase()) itemKeys.push(event.key.toUpperCase())
} else { } else {
itemKeys.push(event.key) itemKeys.push(event.key)

View File

@@ -1,6 +1,6 @@
{ {
"name": "terminus-plugin-manager", "name": "terminus-plugin-manager",
"version": "1.0.0-alpha.14", "version": "1.0.0-alpha.16-8-gfc060ac",
"description": "Terminus' plugin manager", "description": "Terminus' plugin manager",
"keywords": [ "keywords": [
"terminus-plugin" "terminus-plugin"

View File

@@ -1,6 +1,6 @@
{ {
"name": "terminus-settings", "name": "terminus-settings",
"version": "1.0.0-alpha.14", "version": "1.0.0-alpha.16-8-gfc060ac",
"description": "Terminus terminal settings page", "description": "Terminus terminal settings page",
"keywords": [ "keywords": [
"terminus-plugin" "terminus-plugin"

View File

@@ -73,6 +73,7 @@ export class HotkeyInputModalComponent {
} }
ngOnDestroy () { ngOnDestroy () {
this.hotkeys.clearCurrentKeystrokes()
this.hotkeys.enable() this.hotkeys.enable()
clearInterval(this.keyTimeoutInterval) clearInterval(this.keyTimeoutInterval)
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "terminus-terminal", "name": "terminus-terminal",
"version": "1.0.0-alpha.14", "version": "1.0.0-alpha.16-8-gfc060ac",
"description": "Terminus' terminal emulation core", "description": "Terminus' terminal emulation core",
"keywords": [ "keywords": [
"terminus-plugin" "terminus-plugin"

View File

@@ -88,7 +88,7 @@ export class ScreenPersistenceProvider extends SessionPersistenceProvider {
await fs.writeFile(configPath, ` await fs.writeFile(configPath, `
escape ^^^ escape ^^^
vbell on vbell on
deflogin off deflogin on
term xterm-color term xterm-color
bindkey "^[OH" beginning-of-line bindkey "^[OH" beginning-of-line
bindkey "^[OF" end-of-line bindkey "^[OF" end-of-line
@@ -98,6 +98,8 @@ export class ScreenPersistenceProvider extends SessionPersistenceProvider {
defhstatus "^Et" defhstatus "^Et"
hardstatus off hardstatus off
altscreen on altscreen on
defutf8 on
defencoding utf8
`, 'utf-8') `, 'utf-8')
let recoveryId = `term-tab-${Date.now()}` let recoveryId = `term-tab-${Date.now()}`
let args = ['-d', '-m', '-c', configPath, '-U', '-S', recoveryId, '-T', 'xterm-256color', '--', '-' + options.command].concat(options.args || []) let args = ['-d', '-m', '-c', configPath, '-U', '-S', recoveryId, '-T', 'xterm-256color', '--', '-' + options.command].concat(options.args || [])

View File

@@ -28,6 +28,18 @@ export class Session {
...options.env, ...options.env,
TERM: 'xterm-256color', TERM: 'xterm-256color',
} }
if (process.platform === 'darwin' && !process.env.LC_ALL) {
let locale = process.env.LC_CTYPE || 'en_US.UTF-8'
Object.assign(env, {
LANG: locale,
LC_ALL: locale,
LC_MESSAGES: locale,
LC_NUMERIC: locale,
LC_COLLATE: locale,
LC_MONETARY: locale,
})
}
this.pty = nodePTY.spawn(options.command, options.args || [], { this.pty = nodePTY.spawn(options.command, options.args || [], {
name: 'xterm-256color', name: 'xterm-256color',
cols: options.width || 80, cols: options.width || 80,
@@ -118,7 +130,11 @@ export class Session {
async getWorkingDirectory (): Promise<string> { async getWorkingDirectory (): Promise<string> {
if (process.platform === 'darwin') { if (process.platform === 'darwin') {
let lines = (await exec(`lsof -p ${this.truePID} -Fn`))[0].toString().split('\n') let lines = (await exec(`lsof -p ${this.truePID} -Fn`))[0].toString().split('\n')
return lines[2].substring(1) if (lines[1] === 'fcwd') {
return lines[2].substring(1)
} else {
return lines[1].substring(1)
}
} }
if (process.platform === 'linux') { if (process.platform === 'linux') {
return await fs.readlink(`/proc/${this.truePID}/cwd`) return await fs.readlink(`/proc/${this.truePID}/cwd`)