It would be better to just add flags to clear-history rather than a
whole new command.

capture-pane and clear-history already share code so you could just add
S and E to clear-history and shuffle the code in cmd_capture_pane_exec
so they are parsed before then "self->entry == &cmd_clear_history_entry"
block.

Then you will to call grid_move_lines to actually delete the lines and
probably fix up hsize and hscrolled.



On Thu, Jun 08, 2017 at 12:41:40PM -0700, Jimi Damon wrote:
>    Hi Nicholas,
> 
>    Deleting by number is perfect too. I was just describing my ideal use
>    case.
> 
>    I currently use capture-pane using the start and end numbers so similar
>    functionality in a delete would be perfect too. Is this reasonable ? A 
>    delete-history -S 100 -E 120  ( as long as these numbers are outside of
>    the current window I am guessing ).
> 
>    I'm not super knowledgeable about the tmux code base, but I could attempt
>    the code for a pull request if there's a general algorithm (with key
>    buffer deletion ideas ) that you could describe.
> 
>    Thanks,
> 
>    On 06/08/2017 11:09 AM, Nicholas Marriott wrote:
> 
>  That would be a lot of code and infrastructure for something that is of
>  relatively modest use. We could add a way to delete lines in the history
>  by number and then it would be possible to script the rest yourself
>  (save the history, work out which lines you want to delete, then issue
>  commands to delete them).
> 
>  Another alternative would be to have a way to save and reload the
>  history so you could edit it externally, but that has a lot of potential
>  problems.
> 
> 
>  On Thu, Jun 08, 2017 at 10:57:45AM -0700, Jimi Damon wrote:
> 
>     Hi,
> 
>     The thought could just be like copy-mode except now you have kill-mode.
> 
>     Selection could be entire line based ( at first ) and then like a copy,
>     you actively select the areas you want and then Control-W ( emacs ) would
>     just delete it.
> 
>     -Jimi
> 
>     On 06/08/2017 10:55 AM, Nicholas Marriott wrote:
> 
>   It would be possible but I'm not sure how you would possibly make use of
>   it sensibly. You would need to pick and choose the lines manually by
>   number which would take forever. If you want a transcript, it would be
>   better to save the whole history to a file with capture-pane and edit it
>   in emacs.
> 
> 
> 
>   On Thu, Jun 08, 2017 at 10:07:46AM -0700, Jimi Damon wrote:
> 
>      Hi,
>      I was wondering if there's any feature already in the source code or 
> could
>      be added to the source code for Tmux that would allow the user to delete
>      lines from the output buffer that are outside of the current window
>      dimensions.
>      This would make it easy for creating , on the fly, a clean transcript of
>      all of the "real" work that was performed in the window.
>      For instance, if the user hit return 5 times in a bash terminal, you 
> might
>      want to delete that from the transcript...and if it happened off screen (
>      > 1 screen page ago ) , then it seems that it could be done.
>      Thanks for any pointers.
> 
>      --
>      You received this message because you are subscribed to the Google Groups
>      "tmux-users" group.
>      To unsubscribe from this group and stop receiving emails from it, send an
>      email to [email protected].
>      To post to this group, send email to [email protected].
>      For more options, visit https://groups.google.com/d/optout.
> 
>    --
>    You received this message because you are subscribed to the Google Groups
>    "tmux-users" group.
>    To unsubscribe from this group and stop receiving emails from it, send an
>    email to [email protected].
>    To post to this group, send email to [email protected].
>    For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to