Archived
1
0
forked from rarias/bscpkgs

develop: Fix inputrc missing key codes

This commit is contained in:
2020-12-03 13:09:42 +01:00
parent eea9539258
commit b8a1ea3f72
3 changed files with 42 additions and 1 deletions

View File

@@ -0,0 +1,58 @@
{
stdenv
, bash
, bashInteractive
, busybox
, extraInputs ? []
}:
let
inputrc = ./inputrc;
in
stdenv.mkDerivation {
name = "develop";
preferLocalBuild = true;
phases = [ "installPhase" ];
buildInputs = extraInputs ++ [ busybox ];
installPhase = ''
cat > $out <<EOF
#!${bash}/bin/bash
# This program loads a environment with the given programs available.
# Requires /nix to be available.
curdir="\$(pwd)"
export "buildInputs=$buildInputs"
# ${stdenv}
export "PATH=$PATH"
export "out=/fake-output-directory"
export NIX_BUILD_TOP=.
export NIX_STORE=/nix/store
export PS1='\[\033[1;32m\]develop\$\[\033[0m\] '
export TMUX_TMPDIR=/tmp
export TMPDIR=/tmp
export TEMPDIR=/tmp
export TMP=/tmp
export TEMP=/tmp
export LANG=en_US.UTF-8
source ${stdenv}/setup
# Access to bin and nix tools for srun, as it keeps the PATH
export "PATH=\$PATH:/bin"
export "PATH=$PATH:/gpfs/projects/bsc15/nix/bin"
export "SHELL=${bashInteractive}/bin/bash"
export HISTFILE="\$curdir/.histfile"
export INPUTRC=${inputrc}
if [[ -z "\$@" ]]; then
exec ${bashInteractive}/bin/bash
else
exec "\$@"
fi
EOF
chmod +x $out
'';
}

37
garlic/develop/inputrc Normal file
View File

@@ -0,0 +1,37 @@
# inputrc borrowed from CentOS (RHEL).
set bell-style none
set meta-flag on
set input-meta on
set convert-meta off
set output-meta on
set colored-stats on
#set mark-symlinked-directories on
$if mode=emacs
# for linux console and RH/Debian xterm
"\e[1~": beginning-of-line
"\e[4~": end-of-line
"\e[5~": beginning-of-history
"\e[6~": end-of-history
"\e[3~": delete-char
"\e[2~": quoted-insert
"\e[5C": forward-word
"\e[5D": backward-word
"\e[1;5C": forward-word
"\e[1;5D": backward-word
# for rxvt
"\e[8~": end-of-line
# for non RH/Debian xterm, can't hurt for RH/DEbian xterm
"\eOH": beginning-of-line
"\eOF": end-of-line
# for freebsd console
"\e[H": beginning-of-line
"\e[F": end-of-line
$endif