Skip to main content
added 203 characters in body
Source Link

Dump to a file and automatically open the file in vim

This is sweet:

bind-key v 'capture-pane' \; \
  capture-pane -S - \; \
  save-buffer /tmp/tmux \; \
  delete-buffer \; \
  send-keys Escape 'ddivim /tmp/tmux' Enter

This solution supposes that your shell is in vi mode, so that:

  • Escape goes into normal mode
  • dd clears any existing command
  • i goes into insert mode
  • then we run vim /tmp/tmux

Tested in tmux 3.0.

Newline insertion on terminal wrap issue

One problem with this is that it inserts literal newlines on any line that would have been broken up due to terminal wrapping if output lines are longer than you terminal width. And we usually don't want that.

I tried to fix this with -J as mentioned here but that caused another problem, it started adding trailing space characters to each line.

Eric Cousineau proposes a workaround for that with sed, but I'd really rather avoid this as it would remove actual newlines emitted by the commands, which I want to be there.

Kind of the inverse of this was asked at: https://github.com/tmux/tmux/issues/422 Add capture-pane option to only preserve trailing spaces. Maybe the space thins is a fundamental terminal limitation?

Dump to a file and automatically open the file in vim

This is sweet:

bind-key v 'capture-pane' \; \
  capture-pane -S - \; \
  save-buffer /tmp/tmux \; \
  delete-buffer \; \
  send-keys Escape 'ddivim /tmp/tmux' Enter

This solution supposes that your shell is in vi mode, so that:

  • Escape goes into normal mode
  • dd clears any existing command
  • i goes into insert mode
  • then we run vim /tmp/tmux

Tested in tmux 3.0.

Newline insertion on terminal wrap issue

One problem with this is that it inserts literal newlines on any line that would have been broken up due to terminal wrapping if output lines are longer than you terminal width. And we usually don't want that.

I tried to fix this with -J as mentioned here but that caused another problem, it started adding trailing space characters to each line.

Eric Cousineau proposes a workaround for that with sed, but I'd really rather avoid this as it would remove actual newlines emitted by the commands, which I want to be there.

Dump to a file and automatically open the file in vim

This is sweet:

bind-key v 'capture-pane' \; \
  capture-pane -S - \; \
  save-buffer /tmp/tmux \; \
  delete-buffer \; \
  send-keys Escape 'ddivim /tmp/tmux' Enter

This solution supposes that your shell is in vi mode, so that:

  • Escape goes into normal mode
  • dd clears any existing command
  • i goes into insert mode
  • then we run vim /tmp/tmux

Tested in tmux 3.0.

Newline insertion on terminal wrap issue

One problem with this is that it inserts literal newlines on any line that would have been broken up due to terminal wrapping if output lines are longer than you terminal width. And we usually don't want that.

I tried to fix this with -J as mentioned here but that caused another problem, it started adding trailing space characters to each line.

Eric Cousineau proposes a workaround for that with sed, but I'd really rather avoid this as it would remove actual newlines emitted by the commands, which I want to be there.

Kind of the inverse of this was asked at: https://github.com/tmux/tmux/issues/422 Add capture-pane option to only preserve trailing spaces. Maybe the space thins is a fundamental terminal limitation?

added 179 characters in body
Source Link

Dump to a file and automatically open the file in vim

This is sweet:

bind-key v 'capture-pane' \; \
  capture-pane -S - \; \
  save-buffer /tmp/tmux \; \
  delete-buffer \; \
  send-keys Escape 'ddivim /tmp/tmux' Enter

One problem with this is that it inserts literal newlines on any line that would have been broken up due to terminal wrapping.

I tried to fix this with -J as mentioned here but that caused another problem, it started adding trailing space characters to each line. I don't know how to fix that yet.

ItThis solution supposes that your shell is in vi mode, so that:

  • Escape goes into normal mode
  • dd clears any existing command
  • i goes into insert mode
  • then we run vim /tmp/tmux

Tested in tmux 3.0.

Newline insertion on terminal wrap issue

One problem with this is that it inserts literal newlines on any line that would have been broken up due to terminal wrapping if output lines are longer than you terminal width. And we usually don't want that.

I tried to fix this with -J as mentioned here but that caused another problem, it started adding trailing space characters to each line.

Eric Cousineau proposes a workaround for that with sed, but I'd really rather avoid this as it would remove actual newlines emitted by the commands, which I want to be there.

Dump to a file and automatically open the file in vim

This is sweet:

bind-key v 'capture-pane' \; \
  capture-pane -S - \; \
  save-buffer /tmp/tmux \; \
  delete-buffer \; \
  send-keys Escape 'ddivim /tmp/tmux' Enter

One problem with this is that it inserts literal newlines on any line that would have been broken up due to terminal wrapping.

I tried to fix this with -J as mentioned here but that caused another problem, it started adding trailing space characters to each line. I don't know how to fix that yet.

It supposes that your shell is in vi mode, so that:

  • Escape goes into normal mode
  • dd clears any existing command
  • i goes into insert mode
  • then we run vim /tmp/tmux

Tested in tmux 3.0.

Dump to a file and automatically open the file in vim

This is sweet:

bind-key v 'capture-pane' \; \
  capture-pane -S - \; \
  save-buffer /tmp/tmux \; \
  delete-buffer \; \
  send-keys Escape 'ddivim /tmp/tmux' Enter

This solution supposes that your shell is in vi mode, so that:

  • Escape goes into normal mode
  • dd clears any existing command
  • i goes into insert mode
  • then we run vim /tmp/tmux

Tested in tmux 3.0.

Newline insertion on terminal wrap issue

One problem with this is that it inserts literal newlines on any line that would have been broken up due to terminal wrapping if output lines are longer than you terminal width. And we usually don't want that.

I tried to fix this with -J as mentioned here but that caused another problem, it started adding trailing space characters to each line.

Eric Cousineau proposes a workaround for that with sed, but I'd really rather avoid this as it would remove actual newlines emitted by the commands, which I want to be there.

added 179 characters in body
Source Link

Dump to a file and automatically open the file in vim

This is sweet:

bind-key v 'capture-pane' \; \
  capture-pane -JSS - \; \
  save-buffer /tmp/tmux \; \
  delete-buffer \; \
  send-keys Escape 'ddivim /tmp/tmux' Enter

I'm also usingOne problem with this is that it inserts literal newlines on any line that would have been broken up due to terminal wrapping.

I tried to fix this with -J because you obviously don't want newlines to be arbitrarily inserted on every arbitrary terminal wrapas mentioned here! but that caused another problem, it started adding trailing space characters to each line. I don't know how to fix that yet.

It supposes that your shell is in vi mode, so that:

  • Escape goes into normal mode
  • dd clears any existing command
  • i goes into insert mode
  • then we run vim /tmp/tmux

Tested in tmux 3.0.

Dump to a file and automatically open the file in vim

This is sweet:

bind-key v 'capture-pane' \; \
  capture-pane -JS - \; \
  save-buffer /tmp/tmux \; \
  delete-buffer \; \
  send-keys Escape 'ddivim /tmp/tmux' Enter

I'm also using -J because you obviously don't want newlines to be arbitrarily inserted on every arbitrary terminal wrap!

It supposes that your shell is in vi mode, so that:

  • Escape goes into normal mode
  • dd clears any existing command
  • i goes into insert mode
  • then we run vim /tmp/tmux

Tested in tmux 3.0.

Dump to a file and automatically open the file in vim

This is sweet:

bind-key v 'capture-pane' \; \
  capture-pane -S - \; \
  save-buffer /tmp/tmux \; \
  delete-buffer \; \
  send-keys Escape 'ddivim /tmp/tmux' Enter

One problem with this is that it inserts literal newlines on any line that would have been broken up due to terminal wrapping.

I tried to fix this with -J as mentioned here but that caused another problem, it started adding trailing space characters to each line. I don't know how to fix that yet.

It supposes that your shell is in vi mode, so that:

  • Escape goes into normal mode
  • dd clears any existing command
  • i goes into insert mode
  • then we run vim /tmp/tmux

Tested in tmux 3.0.

added 252 characters in body
Source Link
Loading
Source Link
Loading