Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #213 fix #216 fix #215 fix ssh current path modifier #217

Merged
merged 1 commit into from
Jan 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "electerm",
"version": "0.13.1",
"version": "0.13.2",
"description": "terminal/ssh/sftp client(mac, win, linux) based on electron/node-pty/xterm and more",
"main": "app.js",
"scripts": {
Expand Down
11 changes: 3 additions & 8 deletions src/client/components/terminal/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,20 +162,15 @@ export default class Term extends React.Component {
this.startPath = startPath
this.timers.timer1 = setTimeout(this.initData, 10)
}
this.term.on('data', this.onRefresh)
}

initData = () => {
this.term._sendData(`cd ${this.startPath}\r`)
}

onRefresh = (data) => {
debug(data)
let div = Array.from(document.querySelectorAll('.xterm-rows > div') || [])[data.end] || {
textContent: ''
}
let text = div.textContent.trim()
this.extractPath(text)
let text = this.term.buffer.translateBufferLineToString(data.end)
this.extractPath(text.trim())
}

extractPath = text => {
Expand Down Expand Up @@ -233,8 +228,8 @@ export default class Term extends React.Component {
term.attach(socket)
term._initialized = true
}
//term.on('data', this.onRefresh)
this.socket = socket
term.on('refresh', this.onRefresh)
term.on('resize', this.onResizeTerminal)
}

Expand Down