Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open floating terminal on command start not on exit #22

Closed
gwenwindflower opened this issue Jul 22, 2023 · 6 comments
Closed

Open floating terminal on command start not on exit #22

gwenwindflower opened this issue Jul 22, 2023 · 6 comments
Labels
question Further information is requested

Comments

@gwenwindflower
Copy link

I think it would be an improvement to a) use a more featureful terminal window vs the popup b) have it open immediately on command issue, rather than displaying the customized popup with the final data on exit. Happy to hack on this but maybe we can jam a bit so I know my way around the repo better? lmk what you think.

@gwenwindflower
Copy link
Author

yes i am vimming on friday night leave me alone.

@PedramNavid
Copy link
Owner

PedramNavid commented Jul 22, 2023

ah yea i've thought about this! because this uses an async job with a callback, nvim doesnt bubble up the command results until the job is complete.

there are some other options here, similar to what https://github.com/tpope/vim-dispatch/blob/master/doc/dispatch.txt does. i like the idea of giving users options on where dbt runs, e.g. in a separate shell or tmux environment.

the other idea i had was that if everything succeeds, by default just send a vim-notify message, rather than show the entire terminal output (since there's no real benefit there).

taking it one step further, could even parse the dbt errors and send them to vim quickfix so if more than one file has problems you can quickly jump to the next failure with [q and ]q

see #9 and #12

@PedramNavid PedramNavid added the question Further information is requested label Jul 22, 2023
@gwenwindflower
Copy link
Author

gwenwindflower commented Jul 26, 2023

what would you think about trying to implement this for the UI elements? this seems like it would cover everything really well https://github.com/folke/noice.nvim [i may be completely misinterpreting what this plugin does i slept really poorly and i'm not well versed in nvim plugin land yet]

@PedramNavid
Copy link
Owner

i already added nvim notify for the debugging messages a few days ago, so if you have that installed you’ll get these for the logs and errors that dbtpal generates.

it doesn’t solve the delayed terminal output and i don’t think it’ll work for dbts output because it contains color ascii codes which needs a terminal buffer to display properly.

did you have other any other output you were hoping to see? we could probably use json parsing of structured logs in newer dbt versions if you had some other view you were thinking of?

@gwenwindflower
Copy link
Author

gwenwindflower commented Jul 26, 2023

amazing! i need to update.

so to describe from a very high level what i was envisioning as an ideal workflow:

  1. i command to run the current file
  2. this is dispatched to a detached terminal and i stay in the buffer
  3. a notification comes back with success or failure messages based on the outcome, not necessarily the stdout from dbt
  4. if it failed errors are identified in the quickfix

[optional] 5. i can easily pull up the terminal it ran if i need to look at the output

@PedramNavid
Copy link
Owner

PedramNavid commented Jul 26, 2023 via email

@gwenwindflower gwenwindflower closed this as not planned Won't fix, can't repro, duplicate, stale Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants