gbk.py add cursor restore support