Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer tmux splits and tabs over containing terminal #1116

Merged
merged 1 commit into from
Sep 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions apps/tmux/tmux.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from talon import Context, Module, actions

ctx = Context()
mod = Module()

ctx.matches = r"""
tag: user.tmux
mod.apps.tmux = """
tag: terminal
and tag: user.tmux
"""

setting_tmux_prefix_key = mod.setting(
Expand Down Expand Up @@ -45,6 +45,10 @@ def tmux_execute_command_with_confirmation(command: str, confirmation_prompt: st
actions.key("\n")


ctx = Context()
ctx.matches = "app: tmux"


@ctx.action_class("app")
class AppActions:
def tab_open():
Expand Down
13 changes: 12 additions & 1 deletion apps/tmux/tmux.talon
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
tag: user.tmux
app: tmux
-
tag(): user.splits
tag(): user.tabs

# Note that you will need to add something to match the tmux app in your configuration
# This is not active by default
# Adding a file with a matcher for detecting tmux active in your terminal and activating
# the tmux tag is required
# Something like:
#
# title: /^tmux/
# -
# tag(): user.tmux

# pane management - these commands use the word split to match with the splits
# tag defined in tags/splits/splits.talon
Expand Down