Commit Graph

684 Commits

Author SHA1 Message Date
DarkDefender 35e4f2096a Fix bright inverse colors (#621)
Fixes #611.
2017-06-18 17:04:16 -07:00
Aaron Hill 1bd5c45b14 Implement 'backwards tab'
This escape sequence isn't officially documented anywhere, but is
supported by xterm and gnome-vte.
2017-06-18 17:03:13 -07:00
Aaron Hill 3c8514ba10 Make Travis test alacritty on nightly Rust, but allow failures
This allows us to notice and report any regressions that have occured on
nightly, without requiring tests to pass on nightly for the entire build
to succeed.

The `fast_finish` flag will cause Travis to mark the build as successful
if the only builds still running are allowed to fail (e.g. `nightly`).
This allows us to manually inspect builds (or implement some form of
notifications) to see if any nightly regressions have occured, without
slowing down the overall build time.
2017-06-14 11:33:44 -07:00
Aaron Hill f8e6f1f623 Use cursor cell template when handling 'CSI X' escape sequence
This ensures that the cleared cells are set to the proper background
color, which is the main usage of this escape sequence.

Fixes #612
2017-06-14 10:43:42 -07:00
Joe Wilm 529ac47fc8 Add support for Beam, Underline cursors
Notable about this implementation is it takes a different approach for
managing cursor cells that previously. The terminal Grid is now
borrowed *immutably*. Instead of mutating Cells in the Grid, a list is
managed within the RenderableCellsIter. The cell at the cursor location
is skipped over, and instead cells are popped off a list of cursor
cells.

It would be good in the future to share some more code between the
different cursor style implementations for populating the cursor cells
list.

Supercedes #349.
2017-06-11 13:21:13 -07:00
James A Keene 9825adf695 changes osx fallback symbol font style
Previously, the fallback symbol font copied the style of the font from
the config. However, the only available style for the fallback symbol
font is Normal slant, Normal weight.
2017-06-06 20:59:21 -07:00
Martin Algesten 40de8402a7 macOS use system font fallback 2017-06-06 09:47:32 -07:00
Tuomas Siipola 1e064fb3e7 Fix selection when padding is present 2017-06-06 08:26:36 -07:00
Niklas Claesson 84fc7c0bf9 CI with the oldest known working version of rust 2017-06-04 09:46:42 -07:00
Martin Algesten 8776b7ebd5 avoid named field shorthand 2017-06-01 09:47:58 -07:00
Martin Algesten 1fb2c843be final core-graphics extensions moved upstream 2017-06-01 09:47:58 -07:00
Martin Algesten d5ab4183c6 remove code that has been upstreamed 2017-05-31 09:30:54 -07:00
Martin Algesten dafa4ccde9 updated some font deps 2017-05-31 09:30:54 -07:00
Martin Algesten c1ab0042d4 avoid unused warning 2017-05-31 09:30:54 -07:00
Martin Algesten cc3419df2b somewhat DRYer code for font loading 2017-05-31 09:30:54 -07:00
Aaron Hill 0321f3dcfb Implement FocusIn/FocusOut reports (#589)
Implements sending FocusIn/FocusOut events, as defined at
http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-FocusIn_FocusOut
2017-05-29 09:51:49 -07:00
Niklas Claesson 81116fb8a4 Add config file as cli option (#576)
* Parse cli arguments before configuration file

Parsing the cli arguments before the configuration file allows `--help`
and `--version` to be used even if the configuration file is broken.

* Add configuration file to command line arguments

This commit adds a new command line flag `--config-file` to override the default
configuration file location. If the specified file is unavailable,
Alacritty will quit instead of generating a fallback. If the specified
file is invalid, i.e. /dev/null, the compiled in defaults will be loaded
instead.
2017-05-28 17:42:36 -07:00
Joe Wilm 13eac6b673 Fixes font raster for mono, gray bitmaps (#590)
As it turns out, FreeType does not always provide glyph data in LCD mode
as we requested. We now correctly handle several common modes returned
from FreeType including Lcd, Mono, and Gray.

Note that we don't check number of grays at this time since it's

1. Almost always 256, according to FreeType docs
2. Not available in the Rust FreeType bindings being used

Resolves #515
Resolves #185
Resolves #482
2017-05-28 17:36:55 -07:00
ns b9ec141c92 Find and set $WINDOWID to X11 window ID (#586) 2017-05-27 20:08:28 -07:00
Joe Wilm 0e4edc5420 Fix colors in macOS config 2017-05-27 20:02:56 -07:00
Joe Wilm 7766cf02a1 Fix default color scheme
Whites were being rendered very dark.

Resolves #503.
2017-05-27 20:02:36 -07:00
Trevor Joynson 8c2305844c Add script to apply a tilix colorscheme file. (#524) 2017-05-27 19:58:14 -07:00
cac04 7223d44cb2 Add terminfo file supporting true color, italics 2017-05-27 19:55:43 -07:00
Niklas Claesson e2be3c34b4 Remove incorrect close (#552)
Ownership of the slave file descriptor is passed to the process::Stdio
structs and will be closed when they are dropped. If the slave fd is
closed explicitly then the next fd that is opened during the same scope
will get silently closed by the Stdio structs when they are dropped.
2017-05-27 19:52:58 -07:00
Joe Wilm f051e686da Update dependencies 2017-05-25 10:57:42 -07:00
Dominik Miedziński 5977776874 Add support for running commands on key press (#566)
Based on option `command` in key binding section in config, e.g.

    - { key: N,        mods: Control|Shift,    command: alacritty }
    # or
    - {
        key: N,
        mods: Control|Shift,
        command: {
          program: "alacritty",
          args: ["-e", "vttest"],
    }}

specified command will be run in the background on key press. Alacritty
doesn't wait for its result nor block IO.
2017-05-25 09:19:00 -07:00
Joe Wilm 112abf385f Minor cleanup, style fix, dead code removal 2017-05-24 10:56:50 -07:00
Aaron Hill 7eff38d7b7 Add DrainResult enum 2017-05-24 10:56:50 -07:00
Aaron Hill bc8d86f970 Fix typo 2017-05-24 10:56:50 -07:00
Aaron Hill 876dc15152 Ensure that the event loop thread cleanly exits on shutdown
Background:

If a shell process exits with children still alive (typically due to the
`disown` shell builtin), POLLHUP will not be sent to the master PTY file
descriptor. This is due to the fact that the disowned process still has
the slave PTY open as its STDIN, STDOUT, and STDERR.

If a disowned process never reads or writes from its file descriptors
(which is often the case for graphical applications), the event loop
will end up blocking on poll()/select() when not handling user input
received over the mio channel. When Alacritty shuts down and joins on the
event loop thread, there can never be any more input on the mio channel -
the main thread is no longer handling user keystrokes from the window. Unless
a disowned process happens to access its slave PTY file descriptors, the
event loop will never get the chance to deetect that it should exit.

This commit extends the `Msg` enum to include an explicit `Shutdown`
message, which ensures a clean shutdown (e.g. closing the 'recording'
file). This allows the select()/poll() call to remain blocking, instead
of needing to periodically check the shutdown state in between
timed-out calls.

Fixes #339
2017-05-24 10:56:50 -07:00
Martin Algesten 262c70be57 Fix #573. Ensure we don't write 0 bytes to pty
Any action that results in 0 bytes, such as pasting 0 bytes
from the clipboard hangs the terminal (`pbcopy </dev/null`
followed by ctrl-v), hangs the terminal on both macOS and
Linux. This ensures we never send 0 bytes.
2017-05-24 09:10:11 -07:00
Dominik Miedziński 3224847166 Use debug! instead of println! 2017-05-12 08:58:40 -07:00
Ronan Jouchet f6d7f7cdb1 Add Shift+PageUp and Shift+PageDown to default key bindings 2017-05-10 11:02:45 -07:00
Maxim Baz 6b485e4158 Add Ctrl+PageUp and Ctrl+PageDown to default key bindings 2017-05-10 08:10:04 -07:00
N-006 ccd3cc8e6a Fix viewport_size.height calculation
Closes #556
2017-05-10 08:09:02 -07:00
Dominik Miedziński 5c6b7dd244 Fix Device Status reports 2017-05-08 08:38:01 -07:00
Dominik Miedziński 08447a220c Add support for Query Device Status 2017-05-07 15:14:22 -07:00
Joe Wilm 573c5035ef Fix sign error in CoreText font rasterizer
Descent was being reported as a positive value instead of negative. This
caused the background and text alignment to be off dramatically.

Resolves #545
2017-05-06 23:09:07 -07:00
Joe Wilm cbabef36ed Fix bug in SizeInfo::contains_point
Accidentally broke it when refactoring.
2017-05-06 17:37:01 -07:00
Joe Wilm 1d949d72d4 Work around ICE 2017-05-06 12:53:54 -07:00
Tuomas Siipola 9316771f64 Add window padding option
Padding can be configured by using the `padding` field in the config
file, like so:

    padding:
      x: 2
      y: 2

which would result in a 2px padding within each side of the window.
2017-05-06 12:53:54 -07:00
Joe Wilm 149fbaef09 Fix glyph offsets in cell
We previously had a hard-coded value for aligning glyphs within cells.
The font descent is now used, and the offset should be correct by
default.
2017-05-06 12:53:54 -07:00
Joe Wilm 6659810a22 Update build instructions about Homebrew Rust bug 2017-05-03 10:45:06 -07:00
Joe Wilm b9c8515f0d Remove old note about Mesa bug 2017-05-03 10:42:47 -07:00
Joe Wilm 900a2c5fa5 Fix whitespace in README 2017-05-03 10:42:17 -07:00
Joe Wilm f298e0455a Fix bug with tab rendering
Closes #494.
Resolves #529.
Resolves #512.
Resolves #493.
2017-05-01 09:56:42 -07:00
Aaron Williamson f06be732a2 Combine FontOffset and GlyphOffset structs into Delta struct
The two structs are very similar, so there is no reason for them to be
separate. Instead combine them into a single Delta struct, which can be
used to shift a point in a two dimensional plane.
2017-05-01 08:52:22 -07:00
Aaron Williamson 0a1dc56bcf Add glyph offset option to user configuration
Add the ability to move glyphs within their cells on a global basis via
an option in the configuration file.
2017-05-01 08:52:22 -07:00
Aaron Williamson 1277e07671 Remove unnecessary size argument to metrics function
The changes to metric consumption rendered the size argument
unnecessary, remove it.
2017-05-01 08:52:22 -07:00
Aaron Williamson 7fc50f6690 Improve freetype metric usage
The font metrics function was using freetype metrics in an ineffective
way, improve the use of those metrics and remove the now unnecessary
separate default values for font offset in linux.
2017-05-01 08:52:22 -07:00