Feature: Run in a terminal, but send output to quickfix? · Issue #262 · skywind3000/asyncrun.vim · GitHub
Skip to content

Feature: Run in a terminal, but send output to quickfix? #262

Open

Description

@wookayin

The -mode=? option allows where to run the job: async (quickfix window), term, etc.

:AsyncRun -mode term make

This will open a terminal window and run the command there. It's very useful, but one thing I wish is the output of the command can be captured and sent to the quickfix window when the job finishes, and/or streamed to the quickfix window (optionally).

Such a feature would very useful to navigate and browse the command output (which will be lost when the terminal closes), like compilation error and diagnostics messages, etc.

Activity

  1. skywind3000 commented on Oct 31, 2022

    @skywind3000
    Owner

    It is possible:

    :AsyncRun -mode=term -pos=TAB -post=caddf\ ~/.error.txt|copen   ls | tee ~/.error.txt

    If you are using asynctasks.vim:

    You can define a new task:

    [make-tee]
    command=ls | tee ~/.error.txt
    notify=:caddf ~/.error.txt | copen
    output=terminal
    pos=TAB

    then:

    :AsyncTask make-tee
    
  2. wookayin commented on Nov 1, 2022

    @wookayin
    ContributorAuthor

    That's quite ugly -- but quite nice workaround. I think it would be quite non-trivial to stream the output from the terminal (but technically possible, see https://github.com/tpope/vim-dispatch), but first-class and seamless API would be good to have (so one can switch between different modes easily).

  3. skywind3000 commented on Nov 2, 2022

    @skywind3000
    Owner
  4. wookayin commented on Nov 5, 2022

    @wookayin
    ContributorAuthor
    :AsyncRun -mode=term -pos=TAB -program=capture  ls -la
    

    Why does it print some verbose messages like the following?

    (1 of 1): [ls]
    (1 of 29): [ls]
    Press ENTER or type command to continue
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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