# .screenrc
# vim: ft=screen:noml:
# dont display startup message
startup_message off

# defencofing utf-8
defutf8 on
vbell off
# enable auto detach if terminal halt
autodetach on
defscrollback 5000

# dont block command output if the terminal stops responding
# (like if the ssh connection times out for example)
nonblock on

## xterm setup
term xterm-256color
# enable scrolling in xterm
termcapinfo xterm* ti@:te@

# allow editors etc. to restore display on exit
# rather than leaving existing text in place
# for less,vim,etc...
altscreen on
# dont control a window flow
defflow off
# add the entry in the utmp database file for the current window
#deflogin on

# disable activity monitor
defmonitor off
# defmonitor on
# activity "activity -> %n%f %t" 

## keybindings
# make <ALT+G> echo the content of the last line
# "^al" part is just to get rid of info message that otherwise pops up
register g ^a[kY^a]^al
bindkey "^[k" process g

bindkey "\033[Z" next # <S-tab>
bindkey ^[[5;5~ prev # <C-PgUp>
bindkey ^[[6;5~ next # <C-pgDn>

# bind F11 and F12 (NOT F1 and F2) to previous and next screen window
bindkey -k F1 prev
bindkey -k F2 next
# also for ctrl-alt right and left arrows
# note disable in window manager to allow through
bindkey ^[[1;7D prev
bindkey ^[[1;7C next

# window list at the bottom
#hardstatus alwayslastline
#hardstatus string "%-w%{= BW}%50>%n %t%{-}%+w%<"

bind o focus
bind P paste .

bind x
bind ^X
#bind X lockscreen

# # pre 4.2: caption always "%{= kW}%-Lw%{=b kW}%n* %t%{= kW}%+Lw"
# # caption always "%{= kW}%-Lw%{=b kW}%n* %t%{= kW}%+Lw %= %?%E%{=b}ESC %?%?%P%{=b}COPY %?"
# caption always "%{Gk}%-w%{kG}%n %t%{-}%+w"

## 256color
#defbce "on"

# ## truecolor setup
# # https://dandavison.github.io/delta/tips-and-tricks/using-delta-with-gnu-screen.html
# truecolor on
# term screen-256color
# # ANSI (256-color) patterns - AB: background, AF: foreground
# termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
# # use bright colors for bold text
# attrcolor b ".I"
