Allow customization of terminal title #302
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Previously, geometry showed output in three locations:
GEOMETRY_PROMPT
GEOMETRY_RPROMPT
GEOMETRY_INFO
This PR adds two new display locations:
GEOMETRY_TITLE
GEOMETRY_RUNTITLE
Details
Geometry was already implicitly updating the terminal title.
This PR allows configuration of these locations through the same paradigm as drives the rest of geometry.
The original title-controlling functions;
geometry::clear_title
, andgeometry::set_title
ran with an implicit lifecycle.Challenges
De-coloring
The biggest challenge with this PR was de-coloring the output of geometry plugins.
The
deansi
function included here is hand-rolled and worked with the handful of functions I tried out; includinggeometry_path
,geometry_node
, andgeometry_hostname
.Limited testing
I've primarily developed/tested this in iTerm. It looks a little funny in Terminal.app
No current command
This PR is a regression, since the currently-executing command is no longer exposed in the terminal title.
It seems simplest to expose it as a generic geometry function, like
geometry_cmd
or something, but it may only be useful when used inGEOMETRY_RUNTITLE
.