Skip to content

set window title to organization + artifactId + sbt command #7586

@domdorn

Description

@domdorn

I have many microservices. When developing my features, I start most of them using docker, but some of them I start with

sbt run

or

sbt
run

The title of my terminal then just says "sbt run" or "sbt", which makes it somehow hard to differentiate different windows/services, because I start them all with the same command, e.g. take a look at the following screenshot:

grafik
or even more general:
grafik

Now if I have 2+ windows, these will all look very similar. If I want to figure out what application is running in that window, I have to either stop the app to see the directory/prompt or try to guess from the log messages which service is running in that window.

It would be great if there was a way that sbt would set the window title to something like
"sbt run: myOrg % artifactId % version"
e.g.
"sbt run: com.dominikdorn.sbt % sample % 0.0.8-0-02777d76-20240620-2025"

I can set the title interactively in a sbt session using

sbt
console
print("\u001b]0;sbt run : com.dominikdorn % sample % 0.0.8-0-02777d76-20240620-2025 \u0
007")
CTRL+D

It would be great if sbt could do that out of the box on linux/unix terminals :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions