In order to use our pipe protocol described in gscreen design, a number of functions has been implemented in screen code so far:
- :new (generates a new screen session)
- :switchTo n (switches to screen session number n)
- :showWindows (returns a list of current screen sessions)
- :copy (enables copy mode, and returns the marked data)
- :paste data (pastes the data in current screen session)
- :scroll +n (scroll down n lines)
- :scroll -n (scroll up n lines)
- :scroll n (go to line n in scroll buffer)
- :getlinedata n (returns the content of line n of scroll buffer)
- –control-fds = fdnumber (adds the fdnumber to the list of fds that screen listens to their events)
The Gobject based gscreen class is implemented too. In this class two pipes are created, one from g-t/vte to screen and the other from screen to g-t/vte. The pipes are created in the gscreen_session_fork_command method and after that screen program with –control-fds option equal to created pipes is forked. gscreen will be called inside vte_terminal_fork_command in vte.c file.
I’ve hacked g-t a little bit and added a new menu item called “New screen Session”. By clicking on it, a new screen session , using our pipe protocol and :new command, will be generated.