~wrm/dotfiles

df04ceb3d23714a2efe94aefd20d579938fcb4b5 — +wrm 3 months ago 78432eb
Remove shellrc auto-tmux execution

Whether tmux is executed or not is now determined by argument to the
terminal emulator in the desktop environment. This gives nicer semantics
as now a bare shell can be easily executed for small operations, and we
have more control over attaching or starting a new session.
1 files changed, 1 insertions(+), 8 deletions(-)

M .config/shell/shellrc
M .config/shell/shellrc => .config/shell/shellrc +1 -8
@@ 1,12 1,5 @@
#!/bin/sh

# If we can use tmux and are not, attach to existing session or start new one.
# Also checks to be sure we are not in vconsole in case we want to startx.
# We do not exec because we want to be able to exit to sh.
if [ -z "${TMUX}" ] && [ -n "${DISPLAY}" ] && [ -x "$(command -v tmux)" ]; then
	{ tmux attach || tmux; } >/dev/null 2>&1
fi

# Disable ^s freezing interactive shells.
stty -ixon



@@ 18,7 11,7 @@ if [ "${SHELL}" = "/bin/dash" ]; then
	set -V # vi mode

	# Write history on shell exit.
	trap 'fc -ln 0 >> ${HISTFILE}' EXIT
	trap "fc -ln 0 >> ${HISTFILE}" EXIT

	# sudo !!, not expansion but good enough.
	alias s!!='sudo $(fc -ln -1)'