Skip to content

Commit 3a75cce

Browse files
committed
add startup prompt to terminal
1 parent bbcd070 commit 3a75cce

File tree

1 file changed

+24
-6
lines changed
  • entry/src/main/resources/rawfile

1 file changed

+24
-6
lines changed

entry/src/main/resources/rawfile/term.js

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
hterm.Terminal.IO.prototype.sendString = function(data) {
1+
hterm.Terminal.IO.prototype.sendString = function (data) {
22
native.sendInput(data);
33
};
4-
hterm.Terminal.IO.prototype.onVTKeystroke = function(data) {
4+
hterm.Terminal.IO.prototype.onVTKeystroke = function (data) {
55
native.sendInput(data);
66
};
7-
hterm.Terminal.IO.prototype.onTerminalResize = function(width, height) {
7+
hterm.Terminal.IO.prototype.onTerminalResize = function (width, height) {
88
native.resize(width, height);
99
};
10-
hterm.ScrollPort.prototype.onTouch = function(e) {
10+
hterm.ScrollPort.prototype.onTouch = function (e) {
1111
Object.defineProperty(e, 'defaultPrevented', { value: true });
1212
};
1313

@@ -36,7 +36,7 @@ function onTerminalReady() {
3636
window.exports = {};
3737

3838
this.setCursorVisible(true);
39-
term.io.push();
39+
var io = term.io.push();
4040
term.reset();
4141

4242
let decoder = new TextDecoder();
@@ -105,7 +105,25 @@ function onTerminalReady() {
105105

106106
hterm.openUrl = (url) => native.openLink(url);
107107

108+
io.print('Welcome to Harmonix! A project to run Linux ELF binary on HarmonyOS.\r\n');
109+
io.print('Now aarch64 and x86_64 ELF binary are supported(by harmonix-qemu-aarch64 and harmonix-qemu-x86_64).\r\n');
110+
io.print('\r\n');
111+
io.print(
112+
' _ _ _ \r\n' +
113+
' | | | | __ _ _ __ _ __ ___ ___ _ __ (_)_ __\r\n' +
114+
' | |_| |/ _` | \'__| \'_ ` _ \\ / _ \\| \'_ \\| \\ \\/ /\r\n' +
115+
' | _ | (_| | | | | | | | | (_) | | | | |> < \r\n' +
116+
' |_| |_|\\__,_|_| |_| |_| |_|\\___/|_| |_|_/_/\\_\\\r\n'
117+
)
118+
io.print('\r\n');
119+
io.print('\r\n');
120+
io.print('To install or reinstall Alpine Linux, run `harmonix_install_alpine`.\r\n');
121+
io.print('To start Alpine Linux, run `harmonix_run_alpine`.\r\n');
122+
io.print('\r\n');
123+
io.print('You can also use Harmonix in HiShell. To uninstall from HiShell, run `harmonix_remove_alpine`\r\n');
124+
io.print('\r\n');
125+
io.print('To customize linux root filesystem or run x86_64, see harmonix_install_alpine and harmonix_run_alpine script.\r\n');
126+
108127
native.load();
109128
native.syncFocus();
110-
111129
}

0 commit comments

Comments
 (0)