Not quite. #'s can be skipped due to closing of terminals, from my system a few moments ago:
Code:
$ ls /dev/pts/
0 1 2 3 4 5 7
Notice that '6' is missing.
What will work is:
ls /dev/pts/ | wc -l
Code:
$ ls /dev/pts/ | wc -l
8
This counts the # of open terminals reported.