Skip to content

Commit

Permalink
fix: set target in uri
Browse files Browse the repository at this point in the history
  • Loading branch information
UziTech committed Dec 2, 2020
1 parent c7f1b09 commit ddbd54c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/x-terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,13 @@ class XTerminalSingleton {
// Add opener for terminal emulator item.
atom.workspace.addOpener((uri) => {
if (uri.startsWith(X_TERMINAL_BASE_URI)) {
const { searchParams } = new URL(uri)
const target = searchParams.get('target')
searchParams.delete('target')

const item = new XTerminalModel({
uri: uri,
uri,
target,
terminals_set: this.terminals_set,
})
return item
Expand Down Expand Up @@ -443,6 +448,14 @@ class XTerminalSingleton {
url.searchParams.set('relaunchTerminalOnStartup', false)
}
}

if (options.target) {
const target = this.getPath(options.target)
if (target) {
url.searchParams.set('target', target)
}
}

return atom.workspace.open(url.href, options)
}

Expand Down

0 comments on commit ddbd54c

Please sign in to comment.