Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>with tmux, you can split-pane <code>zsh -c while :; do sleep 60; git log ...; done</code> and this should achieve an automagically refreshing git log output in a pane.</p> <p>supply [-vh] [percent] to split-pane to split vert or horiz with a given percent of the terminal. iirc, it splits from bottom and/or right side of terminal, so adjust percentage accordingly.</p> <p>this should have the desired effect of having git log in a pane beside $EDITOR (or below), with appropriate dimensions and automagically refresh every minute. feel free to alter or clean up syntax to suit your needs.</p> <p>EDIT: respawning a pane in tmux can be done with the tmux builtin <code>respawn-pane</code>. you can bind a key something like this to get a simple shortcut</p> <p>bind-key -n M-r respawn-pane -t git:0.1 [command]</p> <p>in this example, i assume 3 things. first, that you have a named tmux session (named git, but this is arbitrary and to your choosing by using <code>rename-session</code> in tmux or by launching the session with <code>new-session -s name</code>). second, that the git log (which is what we want to refresh) is at window of index 0 (this is the first window opened in a session, by default, unless you set <code>base-index</code> to else) and the pane of index 1.</p> <p>so here, it respawns the second pane of the first window in the "git" session by pressing alt-r. if you use the loop i provided before, this is unnecessary to do because the log will refresh itself after each sleep. that may be considered wasteful to some, so you may arbitrarily decide to respawn this pane at your whim instead.</p> <p>[command] is optional. tmux's <code>respawn-pane</code> will execute the command that was given when the pane was spawned at first. in this example, it will be the <code>while</code> loop by default. if you skip the loop and instead just use <code>split-pane [-hv] [percent] "git log ..."</code> then do not provide the optional command parameter as the pane will run it for you smartly. providing the command parameter to <code>respawn-pane</code> will take precedence over the initial command used when spawning the pane.</p> <p>finally, if you do not provide the command parameter to <code>split-pane</code> initially, tmux will run whatever value <code>default-command</code> is.</p> <p>so there you have an overly verbose explanation of how to do what this video does in multiple ways.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload