8

With my current workflow, I frequently use CTRL-z to suspend Vim so I can enter a quick few commands before resuming editing my code with fg (actually, it's CTRL-z again, thanks to the handy ZSH tip on this blog post). The issue is, my terminal ends up being cluttered with job suspension messages which is distracting from the output I wish to see.

Unwanted output:

[1]  + continued  vim

zsh: suspended  vim

The following screenshot shows what this can end up looking like in a standard session: enter image description here

So my question; is there a way to stop CTRL-z and fg printing any output?

JamoBox
  • 183

2 Answers2

2

I am not sure if messages for interactive sessions can be easily changed. But your problem can be solved as Jakuje suggests with a subshell from Vim. Instead of running your command, just :!zsh or :!bash and when you're done exit.

cxed
  • 31
  • Of course you could map this in Vim to make it even easier than C-z and use C-d to exit the shell and return to Vim. – cxed Dec 04 '17 at 16:51
0

One way is to break the pipe. However, the progressing program cannot be called by fg anymore.

You can fist abandon the job to init by command disown -h JobID|PID after running bg JobID|PID. And then you can close the terminal.

The program won't stop. It will more like a daemon since then. However, it can't get anything from stdin and it's output to stdout and stderr will be neglect.

TJM
  • 554
  • Although this didn't quite achieve what I wanted it does technically answer the question, so I'll mark this as correct. – JamoBox Dec 09 '17 at 13:49