Skip to content

yash

  • Consider removing --disable-dirstack if required
  • Consider adding --disable-test if the test builtin is not required
  • Check if we can replace bash entirely even if we enable more features inside bash (will also require yash not going into POSIXly-correct mode when invoked as sh)
  • Depends on a2x and asciidoc
  • Depends on netbsd-curses (libterminfo.so in particular)
  • yash provides its own command line editing library lineedit and does not depend on libedit or readline (this means that the custom bindings under /etc/editrc will not affect yash)
  • install target copies whatever is under share/ to DESTDIR and we do not want share/completion as glaucus uses alternative software
  • All --enable-* flags are already enabled by default (see configure)
  • --no-create is like a dry run that does not generate build files
  • debug is set to false by default
  • --disable-doc removes the need to depend on a2x
  • --disable-help prevents both help $builtin and $builtin --help from working
  • No need to set YASH_GETCWD_AUTO_MALLOC as musl handles getcwd correctly
  • --with-term-lib=terminfo is the only required library to build and run yash (curses, ncurses, ncursesw and tinfo are not needed)
  • default sources sample which sources common
  • yash loads default automatically if no ~/.yashrc is detected
  • share/config is not needed as provide our own default
  • clobber is enabled by default
  • glaucus builds yash with command history and line-editing support so it makes no sense to check if these are enabled or not
  • HISTRMDUP can be set to remove duplicate history items but it makes prediction less accurate
  • MAILCHECK=0 does not disable mail checking and instead checks before every prompt, also unset MAILCHECK alone does not stop MAIL from being set
  • pipe-fail is disabled by default (similar to bash)
  • set --le-predict-empty is counterintuitive
  • : "${LANG:=C}" breaks yash with -yash: cannot read input: Invalid or incomplete multibyte or wide character, this happens as the previous copyright notice in the yashrc (or default) file included a UTF-8 byte, which means that yash has to start with LANG=C.UTF-8 or LANG=en_US.UTF-8 before parsing that configuration file
  • YASH_PS1P='\fi.' dims predicted text
  • \fi. can be combined with colors on modern terminals \fgi. (dimmed green) however this does not work in the tty
  • Prefer forward-semiword and backward-semiword to both their bigword and emacsword variants
  • Prefer backward-kill-semiword to backward-kill-bigword to respect / and - in paths
  • semiword stops at punctuation
  • Blinking \fn. breaks formatting in some environments
  • Do not export every variable as yashrc should respect whatever the user’s environment is (this isn’t a build script to force set the environment)
  • Do not run commands like logname or uname -n inside PS1 as they will run with every prompt (evaluate beforehand instead)
  • Do not use set -o le-trim-right as it breaks formatting
  • echo is a shell builtin and it can print both local and exported variables, while env is an external command that only shows exported variables
  • It is not possible to reset all bindkeys and start from a clean state, so we keep things vanilla and only bind what is needed
  • Can be cross-compiled properly now removing the need for dash in chroot
  • Initialization scripts are executed only if yash was invoked in interactive mode
  • The POSIX standard deprecates combining options and arguments (set -oerrexit) and any POSIX-conforming applications must separate them set -o errexit
  • When yash is in interactive mode the vi mode is automatically activated if the standard input and error are both connected to a terminal
  • The POSIXly-correct mode is automatically enabled when yash is started as sh
  • set -o posixly-correct also enables the POSIXly-correct mode
  • set -o prints a list of shell options and their current values
  • set accepts options in long format set --allexport, with -o/+o (set -o allexport) and as a single character (set -a)
  • Not all set options can be specified as a single character
  • Long format is case-insensitive and irrelevant non-alphanumeric characters are ignored (--le-comp-debug and --LeCompDebug are equivalent)
  • If no is prepended to a long option, the meaning is reversed