Skip to content

feat: add windows support to [[wildcard]] config#346

Open
jradtilbrook wants to merge 2 commits intojoshmedeski:mainfrom
jradtilbrook:feat/wildcard-windows-support
Open

feat: add windows support to [[wildcard]] config#346
jradtilbrook wants to merge 2 commits intojoshmedeski:mainfrom
jradtilbrook:feat/wildcard-windows-support

Conversation

@jradtilbrook
Copy link

@jradtilbrook jradtilbrook commented Mar 9, 2026

Summary

  • Adds a windows field to [[wildcard]] config entries, consistent with the existing windows field on [[session]] configs
  • When a wildcard pattern matches, the configured window layout is applied to the new session
  • Updates the JSON schema and README docs

Usage

[[window]]
name = "code"
startup_script = "~/.config/sesh/windows/code"

[[window]]
name = "server"
startup_script = "~/.config/sesh/windows/server"

[[wildcard]]
pattern = "~/projects/*"
startup_command = "nvim"
windows = ["code", "server"]

Changes

  • model/config.go — added Windows []string to WildcardConfig struct
  • connector/config_wildcard.go — pass wc.Windows to session WindowNames when connecting
  • connector/config_wildcard_test.go — added assertion for WindowNames in wildcard test
  • sesh.schema.json — added windows array to wildcard schema definition
  • README.md — documented the windows field in the wildcard config table

Allow wildcard config entries to specify a windows layout, consistent
with how [[session]] configs support the windows field. This lets users
define a single wildcard pattern that applies both startup commands and
window layouts to all matching directories.
@jradtilbrook jradtilbrook marked this pull request as ready for review March 9, 2026 01:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for applying a predefined window layout when creating sessions via [[wildcard]] config matches, aligning wildcard behavior with existing session window layout configuration.

Changes:

  • Extend model.WildcardConfig with a windows field and wire it into wildcard-based connections.
  • Update tests to assert WindowNames is propagated for wildcard-created sessions.
  • Update the JSON schema and README to document/validate the new windows field.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
model/config.go Adds Windows []string to WildcardConfig to support window layouts in wildcard configs.
connector/config_wildcard.go Propagates wc.Windows into the created session’s WindowNames.
connector/config_wildcard_test.go Verifies wildcard connections set Session.WindowNames as expected.
sesh.schema.json Adds windows to the wildcard config schema definition.
README.md Documents the new windows field for [[wildcard]] entries.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +33 to +36
Src: "config_wildcard",
Name: nameFromPath,
Path: absPath,
WindowNames: wc.Windows,
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

disable_startup_command in [[wildcard]] currently only disables the wildcard’s own startup_command (see startup/config_wildcard.go), but defaultConfigStrategy will still run because session.DisableStartupCommand is never set for wildcard-created sessions. Consider setting DisableStartupCommand: wc.DisableStartCommand on the returned model.SeshSession here so wildcard behavior matches [[session]] and truly suppresses startup commands when requested.

Suggested change
Src: "config_wildcard",
Name: nameFromPath,
Path: absPath,
WindowNames: wc.Windows,
Src: "config_wildcard",
Name: nameFromPath,
Path: absPath,
WindowNames: wc.Windows,
DisableStartupCommand: wc.DisableStartCommand,

Copilot uses AI. Check for mistakes.
@bluskitka
Copy link

Hey! I noticed this PR has been waiting for a bit. If it helps, I’d be happy to take a pass at applying the review suggestions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants