Open SuperfastTimeTraveler opened 2 years ago
Hey, many thanks for your interest in Contour. So if NewTerminal
doesn't spawn in $PWD
right now (talking right out of my head here, IIRC it's simply reading that info from the config, right), then this can be trivially implemented. :+1: Thanks for that idea.
For the second part, I might need to give it some thought and reread, because I think I might not fully understand that just yet.
"Compound Actions" to me reads like being able to run multiple actions on a single shortcut, say Ctrl+N
. That is already possible and even part of the example config that's being auto-generated IIRC. Simply have two input mapping lines using the same key binds but different actions. They're all invoked sequentially in order.
If that's not what you meant, I am sorry for that (I'm not native English speaker :) ), I'll try to reread later with some more time :)
@christianparpart iirc I worked on CWD spawn of new terminal, how did it get broken again?
@christianparpart Sorry, I had been vague in the second part, as I am not a native English speaker either 😅. What I meant by that is whether it is possible to develop something like xterm
's string(string)
method, so that we can key-bind it for doing multiple commands, on say, spawning a new terminal.
Some real life example maybe:
{ mods: [Control, Shift], key: B, action: NewTerminal|RunCommand("btop\n") }
{ mods: [Control, Shift], key: O, action: NewTerminal|RunCommand("curl rate.sx\n" }
In other words, something like this would lead to a crazy amount of customizability, IMO.
Also, @uspasojevic96, can you direct me to the file/the method in which this functionality was implemented, so that I might also look at it too?
This is the PR in question https://github.com/contour-terminal/contour/pull/498
Thanks @uspasojevic96.
Also, totally unrelated, is it possible to do something like contour +NewTerminal +RunCommand(...)
(like, say, nvim --startuptime startup.log +qa
), from the command line itself?
Also, I was thinking of building a completion script for contour zsh
completion. Someone can then generate completion scripts for each shell, maybe, say, using contour completion zsh >| _contour
in .zfunc
. Let me know if I should make one.
You can do something like
contour nvim --startuptime startup.log +qa
.
But if your command runs for time smaller than early-exit-threshold
you get error on terminal that command exited too early. Maybe we can add flag to ignore that error.
There is no RunCommand
action in contour currently.
Also, I was thinking of building a completion script for contour zsh completion
Oh that would be awesome!
early-exit-threshold 0
... should be disabling that. Seems like it's even that quickly exiting that we're running into a race condition. That I can fix along with the current GUI refactor, I think. :)
@christianparpart iirc I worked on CWD spawn of new terminal, how did it get broken again?
@Utkarsh-khambra let's see if we can make it testable, so it won't accidentally break then. :)
EDIT: if not programmatically from the inside, it can 100% be (made) testable on the CI using some script-fu.
At the moment contour
on NewTerminal
action spawns it using pwd
Only on Windows contour doesn't spawn NewTerminal
in CWD , see.
Sounds about right, I did it for macOS
Abstract
Ctrl-Shift-N
, i.e., theNewTerminal Action
doesn't open a new terminal in the present working directory. In general, there is no way so that a user can define their own Actions. I am thinking something likexterm
's translations in.Xresources
, for new key bindings.Motivation
NewTerminal
action can account for$PWD
while spawning a new terminal.Action
s like.Xresources
translations, so that compoundAction
s can be defined.Specification
Example of translations for
UXTerm
in.Xresources
is as follows:Is something like this possible for Contour as well, using
Action
s?