diff --git a/app/hyperterm.js b/app/hyperterm.js index f68b8daf..d170af25 100644 --- a/app/hyperterm.js +++ b/app/hyperterm.js @@ -251,6 +251,9 @@ export default class HyperTerm extends Component { const next = this.state.active - 1; if (this.state.sessions[next]) { this.setActive(next); + } else if (this.state.sessions.length > 1) { + // go to the end + this.setActive(this.state.sessions.length - 1); } } @@ -258,6 +261,9 @@ export default class HyperTerm extends Component { const next = this.state.active + 1; if (this.state.sessions[next]) { this.setActive(next); + } else if (this.state.sessions.length > 1) { + // go to the beginning + this.setActive(0); } }