Commit Graph
442 Commits
Author SHA1 Message Date
Joe Wilm b033162d26 wip 2017-03-07 10:27:53 -08:00
Bryce Fisher-Fleig ad56e3b761 (fix) Associates .desktop file with running process in Linux desktop OSes
Addresses #455
2017-03-06 14:42:30 -08:00
Aaron Hill aa76b29ff7 Handle CSI command J3 (Clear saved lines)
Xterm supports an extension to the CSI command `Erase in Display (ED)`,
under the command number 3. This command is used to clear the scrollback
buffer - e.g. anything not visible on the screen.

Since scrollback is not part of alacritty, the handler for this
command currently does nothing. If at some point scrollback is implemented,
the corresponding `match` arm can be modified to properly handle this.

For an example of a program which uses this command, run the `clear`
command (using ncurses 6.0). In a supported terminal such as
`gnome-terminal`, this will clear anything off of the screen from the
scrollback buffer. Before this change, `alacritty` would generate
an `Unhandled CSI` message.
2017-03-04 15:49:10 -08:00
Aaron Hill d7c0b1115a Handle OSC command '1' (Set Icon Name) 2017-03-03 15:09:29 -08:00
Joe Wilm 00d271b7e0 Fix bug parsing OSC strings
OSC strings with UTF-8 previously failed.
2017-03-02 09:19:01 -08:00
Joe Wilm 119c7d2856 Add support for wide characters 2017-03-02 09:19:01 -08:00
Harlan Lieberman-Berg 55876522a2 font::fc: Remove unneeded clone 2017-03-01 22:07:14 -08:00
Harlan Lieberman-Berg 7bb89e50df font::ft: misc style cleanup. 2017-03-01 22:07:14 -08:00
Harlan Lieberman-Berg d5342a78cd Drop unnecessary unsafe on add_charset 2017-03-01 22:07:14 -08:00
Harlan Lieberman-Berg 6ed7d99453 Switch over to using font_match everywhere. 2017-03-01 22:07:14 -08:00
Harlan Lieberman-Berg 50f27af643 Rework font cache to cache on paths
This is done in order to help prevent us from loading the same
font face over and over again under separate keys.  We still incur
the performance hit of doing the fontconfig search each new glyph,
but that's unavoidable without more extensive refactoring.
2017-03-01 22:07:14 -08:00
Harlan Lieberman-Berg 3ad6869967 First pass of font fallback rendering 2017-03-01 22:07:14 -08:00
Joe Wilm 4b4a187fbd Fix fc::Pattern::add_charset
The lifetime constraints didn't do what I thought, and such constraints
turn out to be unnecessary anyhow.
2017-03-01 22:07:14 -08:00
Joe Wilm 28700ed3dc PoC find font with glyph 2017-03-01 22:07:14 -08:00
Ronan Jouchet f10394e003 Fix #447 - yml: mention showkey -a to get x sequence from key
Am not touching the -macos yaml, as I'm not sure this works under macOS.
2017-03-01 15:18:50 -08:00
Joe Wilm 53507ce7d0 Add ref test for tab background highlighting
Generated with

    echo -e "\x1b[48;5;31m1\t2\n\n3\x1b[0;m"
2017-02-27 08:05:11 -08:00
Anders Rasmussen 96a1503040 Update cell to cursor template when adding a tab. 2017-02-27 08:05:11 -08:00
Joe Wilm 31ed5160a0 Change cursor colors config to use text and cursor
This changes the cursor color config to use the `text` and `cursor`
properties instead of the current `foreground` and `background`
properties. The latter names stop making sense when dealing with cursors
like a vertical bar or underscore. In the new system, the block,
underscore, or vertical bar would always take the color of `cursor`, and
the text would take the color of `text` when using a block, or keep its
normal color when using the underscore or vertical bar.

A warning is now emitted on startup when the old form of cursor color
config is used. This will be a hard error in the future.
2017-02-25 07:55:35 -08:00
Anders Rasmussen fef965c121 hide mouse cursor mac os 2017-02-22 21:07:38 -08:00
Mark Andrus Roberts f1ea49b75d Lazily reset start_time in VisualBell's completed method
Fixes #416. Here's what I think is happening: at short `duration`s, the
VisualBell's [`completed` check](https://github.com/jwilm/alacritty/blob/3ce6e1e4b2924b0d432cbb3e62b4bbef88dd38ff/src/term/mod.rs#L377)
is returning `true` before we've actually had a chance to draw the "normal"
background color. I thought about driving this condition off of whether or not
`intensity` returns 0.0, but we may still miss a draw, I think. Perhaps the best
way to tackle this is to let `completed` lazily reset the VisualBell's
`start_time` (something @jwilm asked about when this feature originally landed),
and to only return `true` when the VisualBell's `start_time` is `None`. This
should effectively delay the final draw until after the VisualBell completes.
2017-02-22 20:57:00 -08:00
Tuomas Siipola 604cc6b25e Document hide cursor when typing behaviour 2017-02-22 14:49:29 -08:00
Tuomas Siipola 2d89f79a29 Fix cursor visibility when window lost focus 2017-02-22 14:49:29 -08:00
Tuomas Siipola 3cc27a4d76 Set cursor only when its visibility changes 2017-02-22 14:49:29 -08:00
Tuomas Siipola 7bb49fabfa Add hide cursor when typing option 2017-02-22 14:49:29 -08:00
Joe Wilm 418df72a07 Bump glutin
Resolves #422
2017-02-17 23:16:37 -08:00
Michel Boaventura e0980df48e Updates Glutin to proper handle dead keys
Resolves #211.
2017-02-17 15:28:46 -08:00
Anders Rasmussen 3ce6e1e4b2 use an empty cell as template when resizing grids 2017-02-17 08:50:35 -08:00
Joe Wilm 62eb1e2938 Implement workaround for Mesa issue
This addresses the issue where systems running Mesa drivers would be an
order of magnitude slower than other terminals. With this patch,
performance is nearly as good as with proprietary drivers. There is one
caveat where, since the cause of slowness hasn't been removed, there is
less time available for rendering on Mesa systems.

I've benchmarked this on my system (i5-3570 @ 3.4GHz, GTX 680) using
`time find /usr` with the following results:

* ~2.0 seconds average with proprietary driver
* ~2.3 seconds average with Mesa driver

cc #125
2017-02-15 10:03:46 -08:00
Anders Rasmussen c49d4a9365 Add TERM config entry 2017-02-14 08:53:18 -08:00
Joe Wilm 24c32dc400 Add default Alt+Backspace keybinding
Resolves #315.
2017-02-13 10:05:31 -08:00
Joe Wilm 18ab8bda9e Disable visual bell by default
cc #406
2017-02-11 20:43:33 -08:00
Joe Wilm 2be3e8fc5b Handle OSC for setting indexed color values
Resolves #26.
2017-02-11 14:18:05 -08:00
Joe Wilm 908ea5543a Move color list to Term struct
The color list needs to be updated by the parser, and this isn't
possible if it's on the config. This change makes sense semantically as
well since it's really part of the terminal state.

This is in preparation for OSC color parsing.
2017-02-11 14:18:05 -08:00
Joe Wilm d2e8a0cd10 Fix issue with cat /dev/urandom 2017-02-11 13:54:37 -08:00
David Tolnay 2063f54455 Update serde_yaml to 0.6.1
This release reports better errors:

> font.use_thin_strokes: invalid type: string "tru", expected a boolean at line 51 column 21
2017-02-10 18:22:45 -08:00
Joe Wilm 7707dcdc5c Print YAML errors using Display
Much nicer error message than with Debug.
2017-02-10 09:40:26 -08:00
Joe Wilm 98c01457df Improvements to default config
* Dimensions default to 80x24 which is standard for terminals
* Remove commented out Solarized color scheme
* Enable visual bell by default
* Add visual bell config to macos defaults
* Fix default keybindings to match xterm terminfo on Ubuntu 16.04
2017-02-10 09:15:36 -08:00
Mark Andrus Roberts fbc7b72271 Add visual bell support
This commit adds support for a visual bell. Although the Handler in src/ansi.rs
warns "Hopefully this is never implemented", I wanted to give it a try. A new
config option is added, `visual_bell`, which sets the `duration` and `animation`
function of the visual bell. The default `duration` is 150 ms, and the default
`animation` is `EaseOutExpo`. To disable the visual bell, set its duration to 0.

The visual bell is modeled by VisualBell in src/term/mod.rs. It has a method to
ring the bell, `ring`, and another method, `intensity`. Both return the
"intensity" of the bell, which ramps down from 1.0 to 0.0 at a rate set by
`duration` and `animation`.

Whether or not the Processor waits for events is now configurable in order to
allow for smooth drawing of the visual bell.
2017-02-07 21:12:56 -08:00
Xiaoyu Yin 92e1cec088 Semantic Selection
Fix tests and add line select

Refactor BidirectionalIter to remove if blocks

Allow for cells tagged with WRAPLINE to continue expanding the selection

Reorganize config into structs

Add test coverage that callbacks are called

Cleanup mouse config

- Uses Duration type for ClickHandler::threshold
- Removes `action` property from ClickHandler--this can be added in a
  backwards compatible way later on
- Renames ClickState::DblClick to DoubleClick

fixup! Cleanup mouse config
2017-02-07 21:04:18 -08:00
Joe Wilm 59295e4431 Add zsh tab completion ref test 2017-02-07 08:08:08 -08:00
Joe Wilm 1852707af3 Implement clearing above cursor 2017-02-07 08:08:08 -08:00
Joe Wilm 098eca8d10 Fix zsh tab completion 2017-02-07 08:08:08 -08:00
Anders Rasmussen edc2c7f5b9 Configurable window dimensions
Adds a configuration option `dimensions` which will set initial
window size by columns and lines. Changes to the config file will
require restart.

resolves #370
2017-02-06 20:45:17 -08:00
Tuomas Siipola 9d44526bf9 Render underline on empty cells
This fixes rendering underlines spanning multiple words.
2017-02-06 11:45:09 -08:00
Tuomas Siipola 6cc6086eed Send mouse wheel commands only if they're supported
Fixes #48
2017-02-06 11:43:26 -08:00
Brandur 12cd04fea2 Add "Quit" action to allow exit on a Cmd-W or Cmd-Q
Adds a new "Quit" action and binds it to Cmd-W and Cmd-Q on Mac OS in an
attempt to make Alacritty feel more like a "normal" citizen of the
operating system. Alternatives like Ctrl-D are okay, but I usually want
to leave my shells nested within Tmux open even if I exit my terminal.
It's also largely selfish: I've built up muscle memory over the years
that takes my fingers to Cmd-Q first (and I suspect I'm not the only
one).

The implementation for an exit is copied from `event.rs` which notably
is already tagged with a FIXME. It seems that `tty.rs` contains a
`process_should_exit` system to help handle a `SIGCHLD`, and it's
possible that these two exit implementations should be merged together.
I could probably tackle that as my next project.

As mentioned in #218, Alacritty can't really spawn other windows right
now, so I've tied in Cmd-W as simply another synonym for quitting until
that's implemented.

Fixes #218.
2017-02-05 18:53:51 -08:00
Joe Wilm 82c9235bb1 Fix bug with restore cursor
The saved cursor position could previously end up outside of the grid if
the terminal was resized to be smaller and then calling a restore.
Restore now ensures the cursor line and column are within grid bounds.
2017-02-03 20:01:13 -08:00
Daniel M. Capella 8f2e7b08a6 readme: Remove stray line
No longer needed thanks to #382.
2017-02-03 12:59:18 -08:00
Joe Wilm f2f750f9f3 Alacritty now compiles on stable Rust 🎉 2017-02-03 08:11:19 -08:00
Joe Wilm 875167a510 Fix bug introduced with save/restore patch
Switching between main and alt grids should no longer clear the main
grid.
2017-02-02 21:40:38 -08:00