Fixes#5256
This updates the macOS apprt to implement the `OPEN_URL` apprt action to
use the NSWorkspace APIs instead of the `open` command line utility.
As part of this, we removed the `ghostty_config_open` libghostty API and
instead introduced a new `ghostty_config_open_path` API that returns the
path to open, and then we use the `NSWorkspace` APIs to open it (same
function as the `OPEN_URL` action).
Fixes#5256
This updates the macOS apprt to implement the `OPEN_URL` apprt action to
use the NSWorkspace APIs instead of the `open` command line utility.
As part of this, we removed the `ghostty_config_open` libghostty API and
instead introduced a new `ghostty_config_open_path` API that returns the
path to open, and then we use the `NSWorkspace` APIs to open it (same
function as the `OPEN_URL` action).
In #7808, we stopped using PS0 to reset the cursor shape because
restoring PS0 in __ghostty_preexec was causing issues (#7802).
The alternate approach of printing the cursor reset escape sequence
directly from __ghostty_preexec caused a new issue: the input cursor
would persist longer than intended, such as when a suspended vim process
was restored to the foreground.
This change takes a different approach. We now conditionally add the
cursor shape escape sequences to PS0 (and PS1, for consistency) when
they don't already appear. The fixes the cursor shape reset problem.
The main downside to this approach is that PS0 will continue to contain
this escape sequence; it won't be cleared/reset in __ghostty_preexec for
the reasons described in #7808. This feels like an acceptable outcome
because there's no harm in the modified PS0 existing for the life of the
bash session (rather than it being modified and then restored for each
command cycle), and it's consistent with how some other terminals' bash
integration works (e.g. kitty).
The nerd font patcher uses `ypadding` as a single subtraction from the
cell height, which means that half of it should go to the top padding
and the other half to the bottom, but we were setting it for both the
top and bottom! This was making the heavy brackets way too small lol
(0.4 of the cell height instead of 0.7)
#7834 introduced the *opposite* problem to what it fixed haha. This
fixes it for real!
The nerd font patcher uses `ypadding` as a single subtraction from the
cell height, which means that half of it should go to the top padding
and the other half to the bottom, this was making the heavy brackets way
too small lol (0.4 of the cell height instead of 0.7)
This better harmonizes fallback fonts with the primary font by matching
the heights of lowercase letters. This should be a big improvement for
users who use mixed scripts and so rely heavily on fallback fonts.
In #7808, we stopped using PS0 to reset the cursor shape because
restoring PS0 in __ghostty_preexec was causing issues (#7802).
The alternate approach of printing the cursor reset escape sequence
directly from __ghostty_preexec caused a new issue: the input cursor
would persist longer than intended, such as when a suspended vim process
was restored to the foreground.
This change takes a different approach. We now conditionally add the
cursor shape escape sequences to PS0 (and PS1, for consistency) when
they don't already appear. The fixes the cursor shape reset problem.
The main downside to this approach is that PS0 will continue to contain
this escape sequence; it won't be cleared/reset in __ghostty_preexec for
the reasons described in #7808. This feels like an acceptable outcome
because there's no harm in the modified PS0 existing for the life of the
bash session (rather than it being modified and then restored for each
command cycle), and it's consistent with how some other terminals' bash
integration works (e.g. kitty).
This generally adjusts the bearings of any glyph whose original advance
was narrower than the cell, which helps a lot with proportional fallback
glyphs so they aren't just left-aligned. This only applies to situations
where the glyph was originally narrower than the cell, so that we don't
mess up ligatures, and this centers the old advance width in the new one
rather than adjusting proportionally, because otherwise we can mess up
glyphs that are meant to align with others when placed vertically.
Partial implementation of #5256
This implements the core changes necessary to open urls using an apprt
action rather than doing it directly from the core.
Implements the open_url action in the GTK apprt.
Note that this should not be merged until a macOS-savvy developer can
add an implementation of the open_url action for the macOS apprt.
Partial implementation of #5256
This implements the core changes necessary to open urls using an apprt
action rather than doing it directly from the core.
Implements the open_url action in the GTK and GLFW apprts.
Note that this should not be merged until a macOS-savvy developer can add
an implementation of the open_url action for the macOS apprt.
We can reintroduce `advance` if we ever want to do proportional string
drawing, but we don't use it anywhere right now. And we also don't need
`sprite` anymore since that was just there to disable constraints for
sprites back when we did them on the GPU.
As discussed in https://github.com/ghostty-org/ghostty/discussions/3134
To allow for the option to render bold text in a different colour for
better visibility as an extension of `bold-is-bright`.
This is a feature that is available in other terminals.
Fixes#7820, and while fixing that I noticed that we need to respect the
cell width constraints since certain glyphs should not expand to 2
cells; before fixing that the heavy bracket would align differently
depending on if it had whitespace after it, which was obviously wrong
and looked terrible.
Fixes#7673
This adds `Ctrl+Alt+T` as a KDE shortcut to the desktop file. If Konsole
is installed (or any other prorgam that has the same shortcut) the user
will need to go into the KDE system settings and manually reassign the
`Ctrl+Alt+T` shortcut to Ghostty.
If Ghostty is the only terminal installed that claims that shortcut KDE
_should_ automatically enable the shortcut (but YMMV).
Non-KDE systems will ignore this setting and if the user desires a
global shortcut to open a Ghostty window it will need to be accomplished
in other ways.
Fixes#7673
This adds `Ctrl+Alt+T` as a KDE shortcut to the desktop file. If Konsole
is installed (or any other prorgam that has the same shortcut) the user
will need to go into the KDE system settings and manually reassign the
`Ctrl+Alt+T` shortcut to Ghostty.
If Ghostty is the only terminal installed that claims that shortcut KDE
_should_ automatically enable the shortcut (but YMMV).
Non-KDE systems will ignore this setting and if the user desires a
global shortcut to open a Ghostty window it will need to be accomplished
in other ways.
This mostly applies to powerline glyphs, but is also relevant for heavy
bracket characters, which need to always be 1 wide otherwise they look
silly because they misalign depending on if there's a space after them
or not.
Previously `ypadding` was effectively ignored, since it's mutually
exclusive with `overlap`. This had a noticeable effect on the heavy
bracket characters U+276C...U+2771, which were much taller than they
should have been.
I also fixed the vertical overlap limit, since negative `overlap` values
are used in the nerd font attributes to create padding on all sides of
the cell, so we don't want to limit the magnitude of the overlap for
vertical padding, we only want to limit it if the value is positive.
That change fixed the vertical padding for a handful of ranges, which
should give more consistent results.
This reverts commit 2fca0477bc7f3c955daf40a0d4663d63ef3d76a1.
The idea of using stdin and stdout was the integrate it in to the build
script, but since we don't want to do that because it contains an eval,
it just makes it more annoying to use.
The termio directory contains the implementation of many terminal
features that those in the terminal reviewer group may want to be
notified about.
---
An example of a terminal related PR that only changed files in the
`termio` directory (and thus didn't assign @ghostty-org/terminal):
https://github.com/ghostty-org/ghostty/pull/7725
I included the entire `termio` directory. If others in the
@ghostty-org/terminal group think this is too broad we can narrow it
down.
Follow-up to #7809, a handful of small fixes/improvements, explained
individually in each commit message.
> [!NOTE]
> Similar to the inverted "monochrome" ft flag fix from #7809, it was
pointed out that "force-autohint" was also inverted, so I did invert
that too, this has the same result of no impact on users who haven't
explicitly set it, but a breaking behavior change for users who have set
it. *These changes definitely need to be pointed out in the 1.2 release
notes!*
This makes it so `zig build run` can take arguments such as
`--config-default-files=false` or any other configuration. Previously,
it only accepted commands such as `+version`.
Incidentally, this also makes it so that the app in general can now take
configuration arguments via the CLI if it is launched as a new instance
via `open`. For example:
open -n Ghostty.app --args --config-default-files=false
This previously didn't work. This is kind of cool.
To make this work, the libghostty C API was modified so that
initialization requires the CLI args, and there is a new C API to try to
execute an action if it was set.
Mainly added type annotations, cleaned up weird AI slop and used more
idiomatic stuff.
This requires Python 3.12 to run (I can downgrade it if need be).
This makes it so `zig build run` can take arguments such as
`--config-default-files=false` or any other configuration. Previously,
it only accepted commands such as `+version`.
Incidentally, this also makes it so that the app in general can now take
configuration arguments via the CLI if it is launched as a new instance
via `open`. For example:
open -n Ghostty.app --args --config-default-files=false
This previously didn't work. This is kind of cool.
To make this work, the libghostty C API was modified so that
initialization requires the CLI args, and there is a new C API to try to
execute an action if it was set.
We no longer need a margin in the atlas because we always sample with
nearest neighbor and our glyphs are always pixel perfect, no worry about
interpolation between adjacent glyphs anymore!
This sets up for a couple improvments (see TODO comments) and also sets
the glyph atlas textures to nearest neighbor sampling since we can do
that now that we never scale glyphs.
The behavior of this flag was the opposite of its description in the
docs- luckily, at the same time, the default (true) was the opposite
from what the default actually is in freetype, so users who haven't
explicitly set this flag won't see a behavior difference from this.
Previously, many glyphs were having their top and right row/column of
pixels clipped off due to not accounting for the slight bearing in the
width and height calculation here.