Browse code

Screen improvements

screenrc - v1.3 - see Versions section for details
screen_profile (cygwin) - v0.1 - see Versions section for details
screen_profile (heron) - v0.0 - see Versions section for details
bash_profile (heron) - v1.5 - see Versions section for details

Fred authored on30/09/2014 18:30:15
Showing4 changed files
... ...
@@ -1,8 +1,8 @@
1 1
 # Title: .screen_profile
2 2
 # Author: Frédéric CHEVALIER <f15.chevalier@gmail.com>
3
-# Version: 0.0
3
+# Version: 0.1
4 4
 # Created in: 2014-08-21
5
-# Modified in: 
5
+# Modified in: 2014-09-30
6 6
 
7 7
 
8 8
 
... ...
@@ -19,6 +19,7 @@
19 19
 # Versions #
20 20
 #==========#
21 21
 
22
+# v0.1 - 2014-09-30: connection to medusa removed
22 23
 # v0.0 - 2014-08-21: creation
23 24
 
24 25
 
... ...
@@ -29,7 +30,6 @@
29 30
 
30 31
 # Start screen with specific tabs
31 32
 screen -t cygwin
32
-screen -t medusa2 bash --login -ic "medusa2"
33
-screen -t medusa2 bash --login -ic "medusa2"
33
+screen -t cygwin
34 34
 
35 35
 select 0
... ...
@@ -1,14 +1,15 @@
1 1
 # Title: .bash_profile
2 2
 # Author: Frédéric CHEVALIER <f15.chevalier@gmail.com>
3
-# Version: 1.4
3
+# Version: 1.5
4 4
 # Created in: 2012-05-25
5
-# Modified in: 2014-08-14
5
+# Modified in: 2014-09-30
6 6
 
7 7
 
8 8
 #==========#
9 9
 # Versions #
10 10
 #==========#
11 11
 
12
+# v1.5 - 2014-09-30: improve screen session detection to print welcome message at server connection even if screen session is running elsewhere
12 13
 # v1.4 - 2014-08-14: adapt behavior of the start screen regarding the screen program
13 14
 # v1.3 - 2014-08-06: part for SSH environment setup moved from .bashrc to avoid setting up SSH environment when connection to a node (qrsh)
14 15
 # v1.2 - 2014-07-09: behaviour modified when login to a node using qrsh (qrsh alias modified / if loop correction for message)
... ...
@@ -116,7 +117,7 @@ fi
116 117
 name=${HOSTNAME%%.*}
117 118
 nb=$(printf "%${#name}s\n" "" | sed "s/ /=/g")
118 119
 
119
-if [[ ! $HOSTNAME =~ compute.* && ! $(ps ux | grep screen | grep -v grep) ]]
120
+if [[ ! $HOSTNAME =~ compute.* &&  -z $STY ]]
120 121
 then
121 122
     nb=$nb=======
122 123
     echo -e "\n\n"
123 124
new file mode 100644
... ...
@@ -0,0 +1,34 @@
1
+# Title: .screen_profile
2
+# Author: Frédéric CHEVALIER <f15.chevalier@gmail.com>
3
+# Version: 0.0
4
+# Created in: 2014-09-30
5
+# Modified in: 
6
+
7
+
8
+
9
+#==========#
10
+# Comments #
11
+#==========#
12
+
13
+# File containing particular action related to a specific terminal
14
+# Must be called at the end of the .screenrc
15
+
16
+
17
+
18
+#==========#
19
+# Versions #
20
+#==========#
21
+
22
+# v0.0 - 2014-09-30: creation
23
+
24
+
25
+
26
+#================================================#
27
+# User specific environment and startup programs #
28
+#================================================#
29
+
30
+# Start screen with specific tabs
31
+screen -t bash
32
+screen -t qrsh 5 bash --login -ic "qrsh"
33
+
34
+select 0
... ...
@@ -1,8 +1,8 @@
1 1
 # Title: .screenrc
2 2
 # Author: Frédéric CHEVALIER <f15.chevalier@gmail.com>
3
-# Version: 1.2
3
+# Version: 1.3
4 4
 # Created in: 2014-08-11
5
-# Modified in: 2014-09-02
5
+# Modified in: 2014-09-30
6 6
 
7 7
 
8 8
 
... ...
@@ -10,6 +10,7 @@
10 10
 # Versions #
11 11
 #==========#
12 12
 
13
+# v1.3 - 2014-09-30: new key binding for moving between screens when in intricate screen session
13 14
 # v1.2 - 2014-09-02: correction of a minor bug on key binding for renaming
14 15
 # v1.1 - 2014-08-21: clean up / reading of .screen_profile added
15 16
 # v1.0 - 2014-08-12: huge improvement from informations get on the Internet
... ...
@@ -86,8 +87,8 @@ bindkey -k F2 title         # F12: rename window
86 87
 
87 88
 bindkey "^[[6;5~" next      # Ctrl-pgup: move to the next window
88 89
 bindkey "^[[5;5~" prev      # Ctrl-pgdown: move to the previous window
89
-#bindkey "^[[1;5C" next     # Ctrl-right arrow: move to the next window
90
-#bindkey "^[[1;5D" prev     # Ctrl-left arrow: move to the previous window
90
+bind p next     # C-x (x)  p: move to the next window
91
+bind o prev     # C-x (x) o: move to the previous window
91 92
 
92 93
 bindkey "^[[6;3~" number +1 # Alt-pgup: move tab up (increase tab number)
93 94
 bindkey "^[[5;3~" number -1 # Alt-pgdown: move tab down (decrease tab number)