Created
July 9, 2018 12:26
-
-
Save malikbenkirane/41c3d5e35a5200762b0263822d6549e8 to your computer and use it in GitHub Desktop.
script that wraps screen command with a fish shell (fish function)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # screen wrapper | |
| function screen | |
| # TODO port: bass source $SOURCMEPATH/screen.sh \; screen $argv | |
| if [ (count $argv) -eq 0 ]; or [ "$argv" = "ls" ] | |
| command screen -ls\ | |
| | head -n -1 | tail -n +2\ | |
| | awk -F'.' '{print $2}'\ | |
| | sed 's/\s*(Attached)/*/' | sed 's/\s*(Detached)//' | |
| else if [ (count $argv) -eq 1 ] | |
| if command screen -rd "$argv" | |
| return | |
| else | |
| echo New screen session | |
| command screen -S "$argv" | |
| end | |
| else | |
| command screen $argv | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment