Beispiel #1
0
 def run(self, prog: TS[D, None], data: D) -> None:
     self._wait(.2)
     r = prog.run(data).unsafe(self.tmux)
     TmuxIO.write('display-panes', '-t', self.tmux_client).result(self.tmux)
     self._wait(.2)
     return r
Beispiel #2
0
def select_pane(id: int) -> TmuxIO[int]:
    return TmuxIO.write(*pane_cmd(id, 'select-pane'))
Beispiel #3
0
def kill_server() -> TmuxIO[None]:
    return TmuxIO.write('kill-server')
Beispiel #4
0
def pipe_pane(id: int, path: Path) -> TmuxIO[None]:
    return TmuxIO.write(
        *pane_cmd(id, 'pipe-pane', quote(f'{pipe_filter} > {str(path)}')))
Beispiel #5
0
def close_pane_id(pane_id: int) -> TmuxIO[None]:
    return TmuxIO.write(*pane_cmd(pane_id, 'kill-pane'))
Beispiel #6
0
def move_pane(id: int, ref_id: int, vertical: Boolean) -> TmuxIO[None]:
    direction = '-v' if vertical else '-h'
    return TmuxIO.write('move-pane', '-d', '-s', pane_id(id), '-t',
                        pane_id(ref_id), direction)
Beispiel #7
0
def resize_pane(id: int, vertical: Boolean, size: int) -> TmuxIO[None]:
    direction = '-y' if vertical else '-x'
    return TmuxIO.write('resize-pane', '-t', pane_id(id), direction, size)
Beispiel #8
0
 def write(self, cmd: str, *args: str) -> 'TmuxIOState[S, A]':
     return TS.lift(TmuxIO.write(cmd, *args))