Fix: Press enter to close failed on exited sessions

This commit is contained in:
zt515 2017-09-16 12:23:40 +08:00
parent 74bb1c3fcb
commit f08fc1e0c9
2 changed files with 2 additions and 4 deletions

View File

@ -23,8 +23,6 @@ class TermViewClient(val context: Context) : TerminalViewClient {
private var mVirtualFnKeyDown: Boolean = false
private var lastTitle: String = ""
var sessionFinished: Boolean = false
var termData: TermDataHolder? = null
override fun onScale(scale: Float): Float {
@ -63,7 +61,7 @@ class TermViewClient(val context: Context) : TerminalViewClient {
when (keyCode) {
KeyEvent.KEYCODE_ENTER -> {
if (e?.action == KeyEvent.ACTION_DOWN && sessionFinished) {
if (e?.action == KeyEvent.ACTION_DOWN && session?.isRunning == false) {
termUI?.requireClose()
return true
}

View File

@ -71,7 +71,7 @@ class TermTab(title: CharSequence) : Tab(title), TermUiPresenter {
}
override fun requireOnSessionFinished() {
termData.viewClient?.sessionFinished = true
// do nothing
}
override fun requireCreateNew() {