Skip to content

Commit 3c56bf1

Browse files
committed
optimized terminal
1 parent d8636b7 commit 3c56bf1

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

frontend/src/views/pty/Terminal.vue

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<a-card :title="$gettext('Terminal')">
33
<div class="console" id="terminal"></div>
44
</a-card>
5-
65
</template>
76

87
<script>
@@ -34,6 +33,7 @@ export default {
3433
window.removeEventListener('resize', this.fit)
3534
clearInterval(this.ping)
3635
this.ping = null
36+
this.term.close()
3737
this.websocket.close()
3838
},
3939
methods: {
@@ -46,13 +46,16 @@ export default {
4646
convertEol: true,
4747
fontSize: 14,
4848
cursorStyle: 'block',
49-
scrollback: 30,
49+
scrollback: 1000,
50+
theme: {
51+
background: 'rgba(3,14,32,0.7)'
52+
},
5053
})
5154
const fitAddon = new FitAddon()
5255
term.loadAddon(fitAddon)
5356
this.fitAddon = fitAddon
5457
term.open(document.getElementById('terminal'))
55-
setTimeout(()=>{
58+
setTimeout(() => {
5659
fitAddon.fit()
5760
}, 60)
5861
window.addEventListener('resize', this.fit)
@@ -71,7 +74,7 @@ export default {
7174
that.sendMessage({Type: 1, Data: data})
7275
})
7376
term.onResize(data => {
74-
that.sendMessage({Type:2, Data:{Cols:data.cols, Rows: data.rows}})
77+
that.sendMessage({Type: 2, Data: {Cols: data.cols, Rows: data.rows}})
7578
})
7679
this.term = term
7780
},
@@ -93,6 +96,6 @@ export default {
9396

9497
<style lang="less" scoped>
9598
.console {
96-
min-height: 800px;
99+
min-height: calc(100vh - 300px);
97100
}
98101
</style>

frontend/version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"1.4.0","build_id":4,"total_build":60}
1+
{"version":"1.4.0","build_id":5,"total_build":61}

0 commit comments

Comments
 (0)