René's URL Explorer Experiment


Title: `here` mode: `send_keys` for env vars and shell replacement diverges from teamocil and is unsafe · Issue #1030 · tmux-python/tmuxp · GitHub

Open Graph Title: `here` mode: `send_keys` for env vars and shell replacement diverges from teamocil and is unsafe · Issue #1030 · tmux-python/tmuxp

X Title: `here` mode: `send_keys` for env vars and shell replacement diverges from teamocil and is unsafe · Issue #1030 · tmux-python/tmuxp

Description: Problem --here mode in tmuxp uses send_keys to inject infrastructure commands (cd, export, shell replacement) into the active pane. This has three failure modes: export is not POSIX-universal — it's a syntax error in fish, nu, and other ...

Open Graph Description: Problem --here mode in tmuxp uses send_keys to inject infrastructure commands (cd, export, shell replacement) into the active pane. This has three failure modes: export is not POSIX-universal — it'...

X Description: Problem --here mode in tmuxp uses send_keys to inject infrastructure commands (cd, export, shell replacement) into the active pane. This has three failure modes: export is not POSIX-universal — it&...

Opengraph URL: https://github.com/tmux-python/tmuxp/issues/1030

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`here` mode: `send_keys` for env vars and shell replacement diverges from teamocil and is unsafe","articleBody":"## Problem\n\n`--here` mode in tmuxp uses `send_keys` to inject infrastructure commands (`cd`, `export`, shell replacement) into the active pane. This has three failure modes:\n\n1. **`export` is not POSIX-universal** — it's a syntax error in `fish`, `nu`, and other non-bash/zsh shells\n2. **Types into foreground programs** — if the active pane is running `vim`, `python`, `htop`, etc., the `cd`/`export` commands are typed as input, corrupting the user's session\n3. **Shell history pollution** — `cd` and `export` commands appear in the user's shell history\n\n### What tmuxp does (3 categories of `send_keys`)\n\n[`builder.py:695-727`](https://github.com/tmux-python/tmuxp/blob/886e63d37dbfeeefab1e645f168178b13ff03b7f/src/tmuxp/workspace/builder.py#L695-L727):\n\n```python\n# 1. Directory change via send_keys\nactive_pane.send_keys(f\"cd {shlex.quote(start_directory)}\", enter=True)\n\n# 2. Environment vars via send_keys (N calls, one per var)\n_here_pane.send_keys(f\"export {_ekey}={shlex.quote(str(_eval))}\", enter=True)\n\n# 3. Shell replacement via send_keys\n_here_pane.send_keys(window_shell, enter=True)\n```\n\n### What teamocil does (1 category of `send_keys`)\n\nteamocil's `--here` only uses `send_keys` for `cd` — the one unavoidable case. Everything else uses tmux primitives:\n\n- **Window rename**: [`rename-window`](https://github.com/remi/teamocil/blob/9ceecf5/lib/teamocil/tmux/window.rb#L67-L73) — tmux command, not `send_keys`\n- **Directory (`cd`)**: [`send_keys cd \"/path\"`](https://github.com/remi/teamocil/blob/9ceecf5/lib/teamocil/tmux/window.rb#L88-L95) — only `send_keys` usage\n- **Pane splitting**: [`split-window -c '/path'`](https://github.com/remi/teamocil/blob/9ceecf5/lib/teamocil/command/split_window.rb#L3-L13) — tmux primitive with `-c` for directory\n- **Environment vars**: Not handled at all — no `send_keys export`\n- **Shell replacement**: Not handled — teamocil doesn't change the running shell\n\ntmuxinator similarly never uses `send_keys` for infrastructure — only for user-specified pane commands. Directories use `-c` on [`new-window`](https://github.com/tmuxinator/tmuxinator/blob/4c836b8/lib/tmuxinator/window.rb#L120-L123) and [`splitw`](https://github.com/tmuxinator/tmuxinator/blob/4c836b8/lib/tmuxinator/pane.rb#L53-L58).\n\n### Impact\n\nCategories 2 and 3 (`export` and `window_shell`) are tmuxp-specific — neither Ruby tool does this. They are the primary source of the POSIX shell assumption and the \"types into vim\" failure mode.\n\n## Proposed solutions\n\nTwo approaches, tracked as sub-issues:\n\n- **Level 1** (#1031): Match teamocil — use `session.set_environment()` for env vars, `respawn-pane` for shell replacement, keep `send_keys cd` only\n- **Level 2** (#1032): Eliminate `send_keys` entirely — use `split-window`/`swap-pane`/`kill-pane` to create a fresh pane with correct dir+env\n\n## References\n\n- teamocil `--here` implementation: [`window.rb:67-95`](https://github.com/remi/teamocil/blob/9ceecf5/lib/teamocil/tmux/window.rb#L67-L95)\n- teamocil pane splitting with `-c`: [`split_window.rb`](https://github.com/remi/teamocil/blob/9ceecf5/lib/teamocil/command/split_window.rb#L3-L13)\n- teamocil `--here` tests: [`window_spec.rb:110-145`](https://github.com/remi/teamocil/blob/9ceecf5/spec/teamocil/tmux/window_spec.rb#L110-L145)\n- tmuxinator window creation (no `send_keys` for infra): [`window.rb:120-123`](https://github.com/tmuxinator/tmuxinator/blob/4c836b8/lib/tmuxinator/window.rb#L120-L123)\n- tmuxinator pane creation with `-c`: [`pane.rb:53-58`](https://github.com/tmuxinator/tmuxinator/blob/4c836b8/lib/tmuxinator/pane.rb#L53-L58)\n","author":{"url":"https://github.com/tony","@type":"Person","name":"tony"},"datePublished":"2026-03-29T09:32:18Z","url":"https://github.com/tmux-python/tmuxp/issues/1030"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:84690469-8894-6e5b-8b08-4c7daf013d8a
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id811A:3D7740:2B39A2:3BF1D4:6B0088BC
html-safe-nonce2fe784934e8ca9407afa4894a1010dc8f9cca2fe29dff9d648d4d555d80237ae
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MTFBOjNENzc0MDoyQjM5QTI6M0JGMUQ0OjZCMDA4OEJDIiwidmlzaXRvcl9pZCI6IjE2MDA2MDI3NjY3NTYwNTUyMjgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac18539018f091b3ed049d1a0434a1f390e72fc9bedc9d30d1e5ef1f526418d3fa
hovercard-subject-tagissue:4163549182
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/tmux-python/tmuxp/1030/issue_layout
twitter:imagehttps://opengraph.githubassets.com/ebcfef0208b9f5535081901c6f3068821297bd0f735072c581454a5b57d6360a/tmux-python/tmuxp/issues/1030
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/ebcfef0208b9f5535081901c6f3068821297bd0f735072c581454a5b57d6360a/tmux-python/tmuxp/issues/1030
og:image:altProblem --here mode in tmuxp uses send_keys to inject infrastructure commands (cd, export, shell replacement) into the active pane. This has three failure modes: export is not POSIX-universal — it'...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernametony
hostnamegithub.com
expected-hostnamegithub.com
None4d3d8e50f02c1d7bf86d5acfa1d3bfe9366abd6528a6b429eb07a168429d2b61
turbo-cache-controlno-preview
go-importgithub.com/tmux-python/tmuxp git https://github.com/tmux-python/tmuxp.git
octolytics-dimension-user_id37234308
octolytics-dimension-user_logintmux-python
octolytics-dimension-repository_id12398170
octolytics-dimension-repository_nwotmux-python/tmuxp
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id12398170
octolytics-dimension-repository_network_root_nwotmux-python/tmuxp
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasedb758f8e02b8257935fb03edf81a3e76eb3abd11
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/tmux-python/tmuxp/issues/1030#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftmux-python%2Ftmuxp%2Fissues%2F1030
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftmux-python%2Ftmuxp%2Fissues%2F1030
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=tmux-python%2Ftmuxp
Reloadhttps://github.com/tmux-python/tmuxp/issues/1030
Reloadhttps://github.com/tmux-python/tmuxp/issues/1030
Reloadhttps://github.com/tmux-python/tmuxp/issues/1030
tmux-pythonhttps://github.com/tmux-python
tmuxphttps://github.com/tmux-python/tmuxp
Codehttps://github.com/tmux-python/tmuxp
Issues113 (113)https://github.com/tmux-python/tmuxp/issues
Pull requests29 (29)https://github.com/tmux-python/tmuxp/pulls
Discussionshttps://github.com/tmux-python/tmuxp/discussions
Actionshttps://github.com/tmux-python/tmuxp/actions
Security and qualityhttps://github.com/tmux-python/tmuxp/security
Insightshttps://github.com/tmux-python/tmuxp/insights
https://github.com/tmux-python/tmuxp
New issuehttps://github.com/login?return_to=https://github.com/tmux-python/tmuxp/issues/1030
New issuehttps://github.com/login?return_to=https://github.com/tmux-python/tmuxp/issues/1030
here mode: send_keys for env vars and shell replacement diverges from teamocil and is unsafehttps://github.com/tmux-python/tmuxp/issues/1030#top
https://github.com/tony
tonyhttps://github.com/tony
on Mar 29, 2026https://github.com/tmux-python/tmuxp/issues/1030#issue-4163549182
builder.py:695-727https://github.com/tmux-python/tmuxp/blob/886e63d37dbfeeefab1e645f168178b13ff03b7f/src/tmuxp/workspace/builder.py#L695-L727
rename-windowhttps://github.com/remi/teamocil/blob/9ceecf5/lib/teamocil/tmux/window.rb#L67-L73
send_keys cd "/path"https://github.com/remi/teamocil/blob/9ceecf5/lib/teamocil/tmux/window.rb#L88-L95
split-window -c '/path'https://github.com/remi/teamocil/blob/9ceecf5/lib/teamocil/command/split_window.rb#L3-L13
new-windowhttps://github.com/tmuxinator/tmuxinator/blob/4c836b8/lib/tmuxinator/window.rb#L120-L123
splitwhttps://github.com/tmuxinator/tmuxinator/blob/4c836b8/lib/tmuxinator/pane.rb#L53-L58
here mode level 1: match teamocil — use set_environment + respawn-pane, keep send_keys cd only #1031https://github.com/tmux-python/tmuxp/issues/1031
here mode level 2: eliminate send_keys entirely — split-window/swap-pane/kill-pane #1032https://github.com/tmux-python/tmuxp/issues/1032
window.rb:67-95https://github.com/remi/teamocil/blob/9ceecf5/lib/teamocil/tmux/window.rb#L67-L95
split_window.rbhttps://github.com/remi/teamocil/blob/9ceecf5/lib/teamocil/command/split_window.rb#L3-L13
window_spec.rb:110-145https://github.com/remi/teamocil/blob/9ceecf5/spec/teamocil/tmux/window_spec.rb#L110-L145
window.rb:120-123https://github.com/tmuxinator/tmuxinator/blob/4c836b8/lib/tmuxinator/window.rb#L120-L123
pane.rb:53-58https://github.com/tmuxinator/tmuxinator/blob/4c836b8/lib/tmuxinator/pane.rb#L53-L58
tonyhttps://github.com/tony
on Mar 29, 2026https://github.com/tmux-python/tmuxp/issues/1030#event-24007910880
here mode level 1: match teamocil — use set_environment + respawn-pane, keep send_keys cd only #1031https://github.com/tmux-python/tmuxp/issues/1031
here mode level 2: eliminate send_keys entirely — split-window/swap-pane/kill-pane #1032https://github.com/tmux-python/tmuxp/issues/1032
tonyhttps://github.com/tony
on Mar 29, 2026https://github.com/tmux-python/tmuxp/issues/1030#event-24007912054
Sign up for freehttps://github.com/signup?return_to=https://github.com/tmux-python/tmuxp/issues/1030
Sign in to commenthttps://github.com/login?return_to=https://github.com/tmux-python/tmuxp/issues/1030
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.