Is there a way to switch to the last terminal tab with some commands or bash script?
What I have got so far:
To switch to the next tab:
xdotool key ctrl+Page_Down
To get the number of terminal tabs:
let terminal_counts=$(ls /dev/pts/ | wc -l)-1
Now I need to know how many times I need to execute
xdotool key ctrl+Page_Down. How to know the current tab number?