Beispiel #1
0
    def save(self):
        (self.homewindow, title) = self.get_number_and_title()
        out("\nCreating directories:")
        if not self.__setup_savedir(self.basedir, self.savedir):
            return 1
        sc.require_dumpscreen_window(self.pid, True)

        if self.enable_layout:
            out("\nSaving layouts:")
            self.__save_layouts()

        out("\nSaving windows:")
        self.__save_screen()

        out("\nCleaning up scrollbacks.")
        self.__scrollback_clean()
        if self.__vim_files:
            self.__wait_vim()
        return 0
Beispiel #2
0
    def save(self):
        (self.homewindow, title) = self.get_number_and_title()
        out("\nCreating directories:")
        if not self.__setup_savedir(self.basedir, self.savedir):
            return 1
        sc.require_dumpscreen_window(self.pid, True)

        if self.enable_layout:
            out("\nSaving layouts:")
            self.__save_layouts()

        out("\nSaving windows:")
        self.__save_screen()

        out("\nCleaning up scrollbacks.")
        self.__scrollback_clean()
        if self.__vim_files:
            self.__wait_vim()
        return 0
Beispiel #3
0
    def __move_all_windows(self, shift, group, kill=False):
        homewindow = int(self.homewindow)

        # create a wrap group for existing windows

        if not self.bNoGroupWrap:
            self.wrap_group_id = self.screen('-t \"%s\" //group' % ('%s_%s' % (group, self.__unique_ident)))
            self.group(False, self.none_group, self.wrap_group_id)

        # move windows by shift and put them in a wrap group
        #for cwin,cgroupid,ctype,ctty in sc.gen_all_windows_fast(self.pid):

        for (
            cwin,
            cgroupid,
            cgroup,
            ctty,
            ctype,
            ctypestr,
            ctitle,
            cfilter,
            cscroll,
            ctime,
            cmdargs,
            ) in sc.gen_all_windows_full(self.pid, sc.require_dumpscreen_window(self.pid,
                    True)):
            iwin = int(cwin)
            if iwin == homewindow:
                homewindow = iwin + shift
                self.homewindow = str(homewindow)

            if not self.bNoGroupWrap and cgroup == self.none_group:
                self.select(self.wrap_group_id)
                self.group(False, group, str(cwin))
            command = '%s -p %s -X number +%d' % (self.sc, cwin, shift)
            if not self.bNoGroupWrap and str(cwin) == str(self.wrap_group_id):
                out('Moving wrap group %s to %d' % (cwin, iwin + shift))
                self.wrap_group_id = str(iwin + shift)
            else:
                out('Moving window %s to %d' % (cwin, iwin + shift))
            os.system(command)
        self.select('%d' % homewindow)
Beispiel #4
0
    def __move_all_windows(self, shift, group, kill=False):
        homewindow = int(self.homewindow)

        # create a wrap group for existing windows

        if not self.bNoGroupWrap:
            self.wrap_group_id = self.screen('-t "%s" //group' % ("%s_%s" % (group, self.__unique_ident)))
            self.group(False, self.none_group, self.wrap_group_id)

        # move windows by shift and put them in a wrap group
        # for cwin,cgroupid,ctype,ctty in sc.gen_all_windows_fast(self.pid):

        for (
            cwin,
            cgroupid,
            cgroup,
            ctty,
            ctype,
            ctypestr,
            ctitle,
            cfilter,
            cscroll,
            ctime,
            cmdargs,
        ) in sc.gen_all_windows_full(self.pid, sc.require_dumpscreen_window(self.pid, True)):
            iwin = int(cwin)
            if iwin == homewindow:
                homewindow = iwin + shift
                self.homewindow = str(homewindow)

            if not self.bNoGroupWrap and cgroup == self.none_group:
                self.select(self.wrap_group_id)
                self.group(False, group, str(cwin))
            command = "%s -p %s -X number +%d" % (self.sc, cwin, shift)
            if not self.bNoGroupWrap and str(cwin) == str(self.wrap_group_id):
                out("Moving wrap group %s to %d" % (cwin, iwin + shift))
                self.wrap_group_id = str(iwin + shift)
            else:
                out("Moving window %s to %d" % (cwin, iwin + shift))
            os.system(command)
        self.select("%d" % homewindow)