Skip to content

Commit

Permalink
fix: fix tmux error
Browse files Browse the repository at this point in the history
  • Loading branch information
lazysegtree committed Feb 9, 2025
1 parent 7ac1d70 commit 0edac87
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
37 changes: 33 additions & 4 deletions .github/workflows/testsuite-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,45 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Install tmux
run: sudo apt-get update && sudo apt-get install -y tmux

- name: Check tmux basic usage
run: tmux -V; tmux new-session -d vi; tmux ls; sleep 2; tmux ls

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22.2
- name: Build superfile
run: ./build.sh

- name: Check installation
run: tmux -V; ls; pwd; ls bin/

- name: Check tmux superfile usage
run: tmux -L superfile new-session -d -s spf_test_session "$(pwd)/bin/spf"; tmux -L superfile ls; tmux -L superfile list-windows -t spf_test_session

- name: Pre run check again
run: ls /tmp/tmux-1001/; tmux -L superfile ls; tmux -L superfile list-windows -t spf_test_session

- name: delay 2 second
run: sleep 2

- name: Pre run check once again
run: ls /tmp/tmux-1001/; tmux -L superfile ls; tmux -L superfile list-windows -t spf_test_session


- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'

- name: Install Dependencies
run: pip install -r testsuite/requirements.txt

- name: Install tmux
run: sudo apt-get update && sudo apt-get install -y tmux
- name: Pre run check
run: ls /tmp/tmux-1001/; tmux -L superfile ls; tmux -L superfile list-windows -t spf_test_session

- name: Run Tests
run: python testsuite/main.py
run: python testsuite/main.py -d
2 changes: 2 additions & 0 deletions testsuite/core/tmux_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def __init__(self, spf_path : str):
super().__init__(spf_path)
self.logger = logging.getLogger()
self.server = libtmux.Server(socket_name=TmuxSPFManager.SPF_SOCKET_NAME)
self.logger.debug("server object : %s", self.server)
self.spf_session : libtmux.Session = None
self.spf_pane : libtmux.Pane = None

Expand All @@ -28,6 +29,7 @@ def start_spf(self, start_dir : str = None) -> None:
window_command=self.spf_path,
start_directory=start_dir)
time.sleep(TmuxSPFManager.SPF_START_DELAY)
self.logger.debug("spf_session initialised : %s", self.spf_session)

self.spf_pane = self.spf_session.active_pane
self._is_spf_running = True
Expand Down

0 comments on commit 0edac87

Please sign in to comment.