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

Add a way to interpolate actual cmdline args into custom command mappings #61

Closed
JonnyHaystack opened this issue Nov 16, 2019 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@JonnyHaystack
Copy link
Owner

Is your feature request related to a problem? Please describe.
Currently, custom command mappings only allow a fixed command. This is limiting in cases where you might only want to change part of the command, but keep the rest.

Describe the solution you'd like
Python's str.format() function makes it possible for users to use Python format specifiers in custom commands, which will then be replaced by the corresponding argument from the actual command.

Example:

Command mapping:

{
  "window_command_mappings": [
    {
      "class": "Code",
      "command": "code -n {1}"
    }
  ]
}

Actual cmdline: ['code', '/path/to/file.txt']

Resulting command that gets saved: code -n /path/to/file.txt

Additional context
#60 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant