Browse Source

Some fixes for DSession and print info on login

pull/15/head
10sr 9 years ago
parent
commit
1a6fc4f78d
1 changed files with 12 additions and 2 deletions
  1. +12
    -2
      shrc

+ 12
- 2
shrc View File

@@ -223,6 +223,14 @@ __safe_run w yuk
# echo # echo
# fi # fi


if test -n "$__MY_DTACH"
then
echo
echo DSession: Current Session: "`basename "$__MY_DTACH"`"
echo DSession: Press C-^ to Exit.
true
fi

i(){ i(){
w w
ss -lnp ss -lnp
@@ -640,7 +648,7 @@ tx(){
tmux start-server tmux start-server
if test -z "$1" if test -z "$1"
then then
echo "usage: tx <session_name>"
echo "usage: tx [<session_name>]"
tmux list-sessions tmux list-sessions
elif test -z "$TMUX" elif test -z "$TMUX"
then then
@@ -655,7 +663,7 @@ tx(){
fi fi
} }


dt(){
__dsession(){
# dt [-h] [<name>] [<command ...>] # dt [-h] [<name>] [<command ...>]
__dtach_dir="${TMP}/dtach" __dtach_dir="${TMP}/dtach"
mkdir -p "${__dtach_dir}" mkdir -p "${__dtach_dir}"
@@ -670,6 +678,7 @@ dt(){
if test -z "$1" if test -z "$1"
then then
# if no arg given show list of sessions # if no arg given show list of sessions
echo "Usage: ds [<session>]"
echo "Sessions:" echo "Sessions:"
ls "${__dtach_dir}" ls "${__dtach_dir}"
return 0 return 0
@@ -704,6 +713,7 @@ dt(){
__MY_DTACH="$soc_name" dtach -c "$soc_name" -e ^^ "$@" __MY_DTACH="$soc_name" dtach -c "$soc_name" -e ^^ "$@"
fi fi
} }
null type dtach && alias ds=__dsession


scr(){ scr(){
test -n "$1" && pf="${1}-" test -n "$1" && pf="${1}-"


Loading…
Cancel
Save