diff --git a/buildroot-v86/board/v86/rootfs_overlay/etc/profile b/buildroot-v86/board/v86/rootfs_overlay/etc/profile index 64a8340..bc78fa7 100644 --- a/buildroot-v86/board/v86/rootfs_overlay/etc/profile +++ b/buildroot-v86/board/v86/rootfs_overlay/etc/profile @@ -11,7 +11,7 @@ source /etc/profile.xrsh source /etc/profile.sh # source js functions -./.profile.js | grep -v undefined +test -f /etc/profile.js && chmod +x /etc/profile.js && /etc/profile.js | grep -v undefined ## forward not-found commands to javascript (via jsh) command_not_found_handle(){ @@ -34,18 +34,26 @@ help(){ echo 'include file into page' "type 'require '" echo 'create AFRAME a-entity' "type 'a_entity [...]" echo '' - echo 'type "man -l /root/manual.md" to read the full manual"' + echo 'type "man xrsh" to read the full manual' ONBOARDING=1 } export TERM=xterm-256color -export PS1="\n\[\033[38;5;57m\]x\[\033[38;5;93m\]r\[\033[38;5;129m\]s\[\033[38;5;165m\]h \[\033[38;5;201m\]# \[\033[0m\]" +export PS1="\[\033[38;5;165m\]> \[\033[0m\]" # interactive login [[ -t 0 ]] && { - cat /etc/motd test -n "$STY" || { - screen -R -T screen-256color -c /root/.screenrc + resize # call twice + resize # otherwise COLUMNS/ROWS is 0 + # add URL-hash as extra screen session + test -z "$HASH" || { + grep 'screen -t #' /root/.screenrc || { + echo "screen -t xrsh+URL 2 /bin/sh -c '${HASH}; sh'" | sed "s/'#/'/g" >> /root/.screenrc + } + } + screen -Aa -R -T screen-256color -c /root/.screenrc } + test -n "$STY" && cat /etc/motd } diff --git a/buildroot-v86/board/v86/rootfs_overlay/etc/profile.sh b/buildroot-v86/board/v86/rootfs_overlay/etc/profile.sh index f61432a..eded036 100644 --- a/buildroot-v86/board/v86/rootfs_overlay/etc/profile.sh +++ b/buildroot-v86/board/v86/rootfs_overlay/etc/profile.sh @@ -46,6 +46,12 @@ require(){ })()' } +man(){ + test "$1" = xrsh && { + cat /root/manual.md | less + } +} + a_entity(){ code="let el = document.createElement('a-entity')" for i in "$@"; do diff --git a/buildroot-v86/board/v86/rootfs_overlay/etc/profile.xrsh b/buildroot-v86/board/v86/rootfs_overlay/etc/profile.xrsh index ee03543..2dc92d8 100644 --- a/buildroot-v86/board/v86/rootfs_overlay/etc/profile.xrsh +++ b/buildroot-v86/board/v86/rootfs_overlay/etc/profile.xrsh @@ -18,7 +18,8 @@ test -d /dev/browser || { echo 1 > /mnt/console.tty ln -s /mnt/console.tty /dev/browser/tty ln -fs /mnt/js /dev/browser/js - touch /dev/browser/console + ln -fs /mnt/console /dev/browser/console + touch /mnt/console touch /dev/browser/index.html } diff --git a/buildroot-v86/board/v86/rootfs_overlay/root/.screenrc b/buildroot-v86/board/v86/rootfs_overlay/root/.screenrc index ff4b233..1a7ce45 100644 --- a/buildroot-v86/board/v86/rootfs_overlay/root/.screenrc +++ b/buildroot-v86/board/v86/rootfs_overlay/root/.screenrc @@ -34,8 +34,4 @@ defbce on # use current bg color for erased chars # setup windows screen -t jsconsole 0 tail -f /dev/browser/console -screen -t jsh 1 jsh -screen -t xrsh 2 - -##If you want it to start with a particular window active, you can add a line like the following: -#select 1 +screen -t xrsh 1 diff --git a/buildroot-v86/board/v86/rootfs_overlay/root/bin/xrsh.menu b/buildroot-v86/board/v86/rootfs_overlay/root/bin/xrsh.menu new file mode 100644 index 0000000..13f4793 --- /dev/null +++ b/buildroot-v86/board/v86/rootfs_overlay/root/bin/xrsh.menu @@ -0,0 +1,2 @@ +#!/bin/sh + diff --git a/buildroot-v86/configs/v86_defconfig b/buildroot-v86/configs/v86_defconfig index 55ab1b5..57765e1 100644 --- a/buildroot-v86/configs/v86_defconfig +++ b/buildroot-v86/configs/v86_defconfig @@ -14,6 +14,7 @@ BR2_PACKAGE_ZIP=y BR2_PACKAGE_LUA=y BR2_PACKAGE_MICROPYTHON=y BR2_PACKAGE_SCREEN=y +BR2_PACKAGE_MG=y BR2_PACKAGE_NANO=y BR2_TARGET_ROOTFS_INITRAMFS=y BR2_TARGET_ROOTFS_ISO9660=y diff --git a/dist/v86-linux.iso b/dist/v86-linux.iso index 7625306..be0dd37 100644 Binary files a/dist/v86-linux.iso and b/dist/v86-linux.iso differ