Skip to content

Using a tmp buffer instead of less when piping the output of a command #524

@ram535

Description

@ram535

I thought it would be nice to pipe the output of commands to a tmp buffer.
I came up with this solution.

#.bashrc
function menos() 
  {content="$(</dev/stdin)";
  vterm_cmd menos "$content"; }
}

;; init.el
(defun my/menos (content)
  (switch-to-buffer (make-temp-name "menos-"))
  (insert content))

(push (list "menos" 'my/menos)
      vterm-eval-cmds)

Now I can do something like this ls -l | menos and a buffer will open with the output of that command. menos is less in spanish.

The problem with this solution

It does not respect the format of command output.
How to make it to respect the format of the command output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions