User Tools

Site Tools


docs:tips_n_tricks:screen.html

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
docs:tips_n_tricks:screen.html [06.02.2012 15:22 CET] peterdocs:tips_n_tricks:screen.html [16.03.2024 00:38 CET] (current) – [Logging and reading logs] peter
Line 90: Line 90:
  
 Actually, I consider this trick dirty and hence both solutions. Actually, I consider this trick dirty and hence both solutions.
 +
 +===== Have a separate history for each screen window =====
 +Put this in your ''.profile'', ''.bashrc'', ''.zshenv'' or whatever shell your're using:
 +
 +  [ -n "$WINDOW" ] && HISTFILE="${HISTFILE:-~/.screen_history}.${WINDOW}"
  
 ===== sample .screenrc file ===== ===== sample .screenrc file =====
  
-  #remove some stupid / dangerous key bindings +<code screen .screenrc> 
-  bind ^k +#remove some stupid / dangerous key bindings 
-  bind ^\ +bind ^k 
-  bind k +bind ^\ 
-  # # don't lock screen accidently - use if you don't know the accounts password (e.g. when access is managed by ssh keys) +bind k 
-  # bind x +# # don't lock screen accidently - use if you don't know the accounts 
-  # bind ^x +# # password (e.g. when access is managed by ssh keys) 
-  startup_message off +# bind x 
-  vbell on +# bind ^x 
-  vbell_msg " Klingeling! " +startup_message off 
-  bindkey -k kb stuff ^? +vbell on 
-  defscrollback 500 +vbell_msg " Klingeling! " 
-   +bindkey -k kb stuff ^? 
-  caption always +# Enable cycling backward throug regions in Putty by C-a,Shift+TAB 
-  # # show window title and optional +bindkey -t "^A^[[Z" focus prev 
-  # # hardware status line text +# Make C-a C-a work smooth again 
-  # caption string "%?%F%{.c.}%?%3n %t%? [%h]%?" +bindkey -t "^A^A" other 
-  # windowlist string  "%3n %t %?[%h]%?" + 
-   +defscrollback 500 
-  # show window title if set,  + 
-  # else hardware status line text +# make $HOME the base for all relative paths 
-  windowlist string "%3n %?[%h]%:%t%?" +chdir 
-  # show clock in caption line + 
-  caption    string "%?%F%{.c.}%?%3n%? [%h]%: %t%?%=| %c:%s " +caption always 
-   +# # show window title and optional 
-  hardstatus on +# # hardware status line text 
-  hardstatus alwayslastline +# caption string "%?%F%{.c.}%?%3n %t%? [%h]%?" 
-  msgminwait 0+ 
 +# # show window title if set, else hardware status line text 
 +# windowlist string "%3n %?[%h]%:%t%?" 
 +# windowlist title "Num Name|HW Status" 
 +# show window title and hardware status line text if set 
 +windowlist string "%3n %t %?[%h]%?" 
 +# windowlist title "Num Name [HW Status]" 
 +# # Use approximately original windowlist string appended by hardware statusline if set 
 +windowlist string "%3n %t%=%?[%h]    %:%?%f 
 +windowlist title "Num Name%=[HW Status] Flags" 
 +# show clock in caption line 
 +caption    string "%?%F%{.b.}%H: %?%3n%? [%h]%: %t%?%=| %c:%s " 
 +# Higlight active window, show hold and escape-key state 
 +caption    string "%?%F%{.bw}%?%H: %3n%?%E %{.rw}~a~%{-}%?%?%P %{.wb}~HOLD~%{-}%?%? [%h]%: %t%?%-11=| %c:%s " 
 + 
 +hardstatus on 
 +hardstatus alwayslastline 
 +msgminwait 0 
 + 
 +logfile .screenlog/screen.%S.%n.%Y-%m-%d.%0c.log 
 + 
 +zombie xr onerror 
 +# If you're using bash (won't hurt otherwise) 
 +setenv PROMPT_COMMAND 'screen -p "$WINDOW" -X title "$PWD"' 
 +</code> 
 +===== Logging and reading logs ===== 
 +<code screenrc .screenrc> 
 +
 +chdir 
 +logfile screenlog/screen.%S.%n.%Y-%m-%d.%0c.log 
 +
 +</code> 
 + 
 +  col < ~/screenlog/screen.pts-0.www.14.2021-09-06.09:28.log | less 
 + 
 +__References__: 
 +  * [[https://superuser.com/questions/236930/how-to-clean-up-output-of-linux-script-command|How to clean up output of linux 'script' command]] 
 +===== Starting root shell in new screen with non-default shell =====
  
 +  screen -t root sudo ZDOTDIR=$HOME -i /bin/zsh -
  
 +  screen -t root sudo su - -c "ZDOTDIR=$HOME exec zsh"
docs/tips_n_tricks/screen.html.1328538150.txt.gz · Last modified: 06.02.2012 15:22 CET by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki