Cygwin: how to have multiple tabs in Cygwin's Mintty

root's picture

If you need (as I do) multitab support in mintty, you can have it with the help of ... wait for it ... SCREEN!
It was always there but I haven't got this brilliant idea to use it.
Also, do not get fulled about the title as this works in any linux like environment.

The idea is not mine. I have "borrowed" it from here with few modifications.

The script

Name it as you want, put it where you want, as long as you remember where it is and how to run it :).

#!/bin/bash

SCREEN='/usr/bin/screen'
DATE=$(date +%s)
MERGE="${SCREEN}${DATE}"

rm -f ${MERGE}
cat ~/.multitabs > ${MERGE}

cat << EOF >> ${MERGE}
caption string '%t'
screen -t "ONE"
screen -t "TWO"
screen -t "THREE"
screen -t "FOUR"
screen -t "FIVE"
select "ONE" 
EOF

screen -c ${MERGE}
rm -f ${MERGE}

The configuration file

Name it .multitabs and saved it in your user's home.

#General Settings
term xterm
startup_message off
vbell off
caption always

#Ctrl-up, Ctrl-down to move between regions
bindkey "^[[1;5A" focus up
bindkey "^[[1;5B" focus down

#Ctrl-left, Ctrl-right to move between windows
bindkey "^[[1;5C" next
bindkey "^[[1;5D" prev

#F9, F10, F11 to decrease, increase, equalize region size
bindkey "^[[20~" resize -1
bindkey "^[[21~" resize +1
bindkey "^[[23~" resize =

#F1, F2 to move to top/bottom region
#F3 to clear both regions
#F4 to close all windows and exit screen
bindkey -k k1 focus top
bindkey -k k2 focus bottom
bindkey -k k3 eval "clear" "focus up" "clear" "focus up"
bindkey -k k4 quit

#F5 windowlist, #F6 rename window
bindkey -k k5 windowlist
bindkey -k k6 title

Thou shalt not steal!

If you want to use this information on your own website, please remember: by doing copy/paste entirely it is always stealing and you should be ashamed of yourself! Have at least the decency to create your own text and comments and run the commands on your own servers and provide your output, not what I did!

Or at least link back to this website.

Recent content

root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root