Sbt: Running sbt in background will be suspended

Created on 23 May 2019  路  3Comments  路  Source: sbt/sbt

steps

Run sbt &(with or without command, e.g. sbt package &)

environment

system: Mac OS or Cent OS
shell: bash or zsh

problem

The background process will be stopped and [2] + suspended (tty output) sbt prints out.

expectation

sbt should run in the background.

notes

  • Many people says that suspended message is caused by stty's tostop flag, but I've already make sure that flag sets to off(-tostop) on my machines.
  • I've tried to redirect stdout to file using >/dev/null 2>/dev/null, but it was still suspended.
  • I've looking through sbt source code, it seems sbt using log4j to print messages to console, but I failed to find something related with the suspension.

sbt version: [1.2.8, 0.13.15]

Bug

Most helpful comment

This seems to work for me:

sbt -Djline.terminal=none < /dev/null &

All 3 comments

This seems to work for me:

sbt -Djline.terminal=none < /dev/null &

Looks like jline.terminal does the magic. And I can now write scripts with background sbt tasks.

Thank you for the reply馃構

This still feels hacky. There should be a clear option (e.g., sbt.ci or --batch) that guarantees nothing will be done with the terminal. It gets in the way in other places (e.g., using timeout).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eed3si9n picture eed3si9n  路  3Comments

eed3si9n picture eed3si9n  路  3Comments

MasseGuillaume picture MasseGuillaume  路  3Comments

vhiairrassary picture vhiairrassary  路  3Comments

kim0 picture kim0  路  4Comments