Commit Graph

684 Commits

Author SHA1 Message Date
Yan d52e545db3 Correct linefeed handling when scroll region set (#855)
Linefeeds should only move the cursor down if it's before the end of
the scroll region.

The "out of bounds" panic was triggered by linefeeds going off the
bottom of the screen when the scroll region end was above the cursor.

Note: https://vt100.net/docs/vt102-ug/chapter5.html
"Characters added outside the scrolling region do not cause the screen to scroll."
2017-11-11 09:23:43 -08:00
thelearnerofcode 0bae7ae722 Fixed typo in README.md (#876) 2017-11-11 08:24:08 -08:00
thelearnerofcode bdb360ed1d Support integer font size in config (#886)
Fixes #882
2017-11-11 08:23:49 -08:00
Bailey f68558e9dc Link to FAQ when referencing it (#881) 2017-10-31 08:54:30 -07:00
Martin Lindhe 5b444375f2 fix some typos in comments 2017-10-30 09:25:13 -07:00
Martin Lindhe f646f6c9f8 config_subsitute(): fix typo by renaming to config_substitute() 2017-10-30 09:25:13 -07:00
Ty Coghlan 7c4e84c695 set_urgent on mac throws a warning (#867)
On mac, compiling throws a warning due to `is_urgent` not being used within `set_urgent`. This can be changed just by using an underscore instead.
2017-10-26 18:48:11 -07:00
Joe Wilm 22ccd7b4b1 Fix stack overflow
Resolves #872
2017-10-26 18:46:44 -07:00
Dustin 16c047b08a Change cursor from pointer to text (#778)
It seems that (as a rule) terminal emulators use the text mouse cursor rather
than the pointer that is used now. This commit changes the cursor to
using winit's built-in configuration function.
2017-10-22 11:34:31 -07:00
Joe Wilm bfdd7b0062 Fix typo 2017-10-22 08:43:02 -07:00
Roel a1174797b4 Rewrite err_println to eprintln introduced in Rust 1.19 (#799) 2017-10-22 08:42:40 -07:00
Joe Wilm 8af4a4b55b Update README.md with more Wayland
Adds a call to action on how to improve Wayland support in Alacritty.
2017-10-21 17:08:16 -07:00
Barret Rennie f6f2bcd024 Set urgent WM flag on bell on X11 systems (#812)
Sets the urgent WM flag when bell is emitted on X11 systems.
Additionally, the flag is cleared on focus because not all WMs clear it
automatically.
2017-10-21 16:03:58 -07:00
Joe Wilm b79574ee82 Fix solid background color opacity (#847)
Since landing the patch adding transparency support to Alacritty,
there's been an issue where othewise solid background cells were also
being rendered partially transparent. Now, all filled background cells
are rendered fully opaque.

Some logic was added to support discarding filled backgrounds which had
the same color as the default background. This means that, if the
default background is #000 and a cell has that background, it will never
be rendered opaque. This may not be correct.

Note that many truecolor vim color schemes print spaces for default
colored background cells. Performance can be dramatically improved by
using ctermbg=NONE guibg=NONE to skip rendering those cells.
2017-10-21 15:26:42 -07:00
Robert Bittle 7a5eebd094 List all valid actions in config error message (#848) 2017-10-21 15:26:14 -07:00
Hugo Tunius 2ea6ec5c8f Update macOS icon with icon from #285 (#856) 2017-10-21 15:25:48 -07:00
Joe Wilm 9f79d72109 Add Function + Modifier keybindings (#853)
Also rearranged the default config slightly to move the long key binding
list to the bottom of the file.

Resolves #690
Resolves #727
2017-10-20 07:59:28 -07:00
Joe Wilm 5ac42bb13b Fix render issues on macOS (#845)
Parts of neighboring glyphs in the atlas were being rendered
incorrectly. The issue is resolved by aligning cells to the pixel grid.

This behavior was achieved previously by first applying integer
truncation before casting to a float.

Fixes #844.
2017-10-17 10:15:24 -07:00
Joe Wilm d3151dfbf9 Fix config reloading
Must have been broken when upgrading notify-rs
2017-10-16 18:38:57 -07:00
Joe Wilm 1cf9a179bc Fix default config reload value
This shouldn't have any effect, but at least the default value is now
consistent with the default deserialization value.
2017-10-16 18:37:08 -07:00
Erik Nilsen 07e42b2e25 Use correct keyname for decreasing font size in MacOS (#843)
* Use correct keyname for decreasing font size in MacOS
* Prefer Command instead of Control to match other TEs
2017-10-16 09:57:05 -07:00
Joe Wilm f7cb0009cc Drop nightly feature
Forgot to remove after being done with valgrind
2017-10-14 23:31:08 -07:00
Joe Wilm e8f5ab89ee Fix memory leak from font resizing
The source of the leak was loading up multiple copies of the FT_face
even when not necessary. Fonts are now appropriately cached for
FreeType when going through the `Rasterize::load_font` API.

Additionally, textures in the glyph cache are now reused.

The result of this is that resizing to already loaded fonts is free
from a memory consumption perspective.
2017-10-14 19:07:43 -07:00
Dan Aloni 8a0b1d9c3f Implement user actions for font resize (#625)
Adds support for font resizing at run-time. Three new actions are
introduced:

* IncreaseFontSize - Increases current font size by 1.0
* DecreaseFontSize - Decreases current font size by 1.0
* ResetFontSize - Resets font size to that specified in the
  configuration.

The stock config files have example configuration for each which should
match gnome-terminal. For convenience, the config entries are:

    - { key: Key0,     mods: Control, action: ResetFontSize    }
    - { key: Equals,   mods: Control, action: IncreaseFontSize }
    - { key: Subtract, mods: Control, action: DecreaseFontSize }
2017-10-14 10:35:56 -07:00
Joe Wilm fd410f9ec8 Fix resize behavior
Should prevent the messed up background colors that appear in some
situations (especially on tiling WMs).
2017-10-14 10:08:19 -07:00
Robert Günzler 68cca6eb38 Support web notation for hex colors 2017-10-09 10:14:43 -07:00
Joe Wilm fc658b31d7 Add fontconfig instructions to Linux config 2017-10-09 08:51:25 -07:00
Joe Wilm 6916537858 Update servo-fontconfig-sys fork
Fixes naming collision issue on Fedora 26.
2017-10-08 22:33:01 -07:00
Joe Wilm 2ea20f4823 Scale all fonts based on device-pixel-ratio
Rather than use DPI from config, use device-pixel-ratio from winit. This
is computed using the display DPI anyhow, so it should have the same
effect.
2017-10-08 22:20:58 -07:00
Dan Aloni b03ec0df37 Support bitmap fonts
To allow FontConfig to work with Bitmap font, we shall pass the size
we are interested in, and account for the size returned in the font
matching process. This is, because we cannot scale those fonts.

FontConfig will return the closest match, and we take its returned
pixel size back when we are rendering the glyphs.

There's an oddity when call set_char_size in TrueType - we need to
behave as if the DPI is 72. It is due to the following macro:

    #define FT_REQUEST_HEIGHT( req )                                        \
          ( (req)->vertResolution                                           \
              ? ( (req)->height * (FT_Pos)(req)->vertResolution + 36 ) / 72 \
              : (req)->height )

Further work can allow for integer scaling of the largest bitmap
font variant.

Tested with Terminus PCF-type font under Linux.

This addresses issue #582 .
2017-10-08 22:20:58 -07:00
Joe Wilm 619e877819 Add support for env_logger
When RUST_LOG environment variable is set, uses env_logger instead of
our custom logger. This is desirable for debugging purposes.
2017-10-08 22:20:58 -07:00
Joe Wilm 31d1087b86 FreeType rasterizer respects some fontconfig
The FreeType rasterizer now reads settings like antialias, rgba,
lcdfilter, and hintstyle and chooses FreeType settings accordingly. The
result is that Alacritty fonts should look similar to the rest of the
system.
2017-10-08 22:20:58 -07:00
Joe Wilm 46d88ad244 Improve glyph rasterization performance
The hash map of key -> face was previouly cloned every time a glyph was
rasterized. This refactored the rasterization path to be more borrowck
friendly.

Sadly, this implementation is not *that* clean, but once NLLs land, much
of this can be cleaned up.
2017-10-08 22:20:58 -07:00
Joe Wilm cbe484a56b Remove unused macros 2017-10-08 22:20:58 -07:00
Joe Wilm 6c74c51cef Extend and improve FcPattern bindings
The fontconfig `FcPattern` type is wrapped as `fc::Pattern` and
`fc::Pattern` ref. All methods for accessing data on the pattern now
return an `Iterator`. This API turns out to be much more ergonomic than
providing an integer index. We also override the default `nth`
implementation of `Iterator` on these accessors to allow random
(incremental only) access.

For instance, accessing `family` attributes from a pattern:

    let families = pattern.family();
    let second = pattern.nth(1);

Or printing available styles

    for style in pattern.style() {
        println!("style={}", style);
    }
2017-10-08 22:20:58 -07:00
Joe Wilm 65065e06d1 Organize fontconfig wrappers
Each Fc type is split into a separate file. This organization will help
as features are added to the bindings.
2017-10-08 22:20:58 -07:00
Joshua Strobl 044b546267 Update Solus deps (#792)
Removed freetype2-devel, it isn't necessary given fontconfig-devel depends on freetype2-devel, just as it depends on expat-devel.
2017-10-07 08:02:55 -07:00
Joe Wilm 88c1dabefc Revert "Update glutin & fix a few wayland issues (#815)"
This reverts commit e17d38167e.

Was breaking builds for mac users.
2017-10-06 11:32:53 -07:00
Victor Berger e17d38167e Update glutin & fix a few wayland issues (#815)
This PR fixes a few wayland issues of alacritty (and updates glutin on
the process because it is needed).

Mainly two changes are done:

1. Add a drawing_ready() method on Window: see
https://docs.rs/winit/0.8.2/winit/os/unix/trait.WindowExt.html#tymethod.is_ready
for explanations. Hopefully glutin will be able to handle it itself in
the future, but it currently does not.

2. resize window and OpenGL contextes.

The way wayland forces winit to draw its own decorations and how surface
size is defined by its content means that in practice:

- winit's window.set_inner_size() defines the dimensions of the
  borders
- glutins gl_window.resize() defines the dimensions of the content
  (and is a noop in other platforms)

It is for now glutin's user responsibility to keep them in sync
otherwise borders are drawn stupidly. This PR changes the resize methods
of alacritty::Window to always update both.

This fixed the borders issues for me, tested on weston.
2017-10-06 08:47:51 -07:00
Peter Butkovic 934c205a46 centos/RHEL 7 build instructions added (#813) 2017-10-04 08:49:34 -07:00
Joe Wilm c8dcbd3308 Add ref test for CSI REP 2017-09-30 16:30:04 -07:00
Jasper Bryant-Greene 2bfb3f7024 implement ANSI CSI REP (Repeat) 2017-09-30 16:30:04 -07:00
Aaron Hill 5f7885749c Use clippy = "*", update, and fix some warnings (#796)
Because there are so many clippy warnings in the current codebase,
this commit removes '#![cfg_attr(feature = "clippy", deny(clippy))]',
to make it easier to fix warnings incrementally.
2017-09-27 17:29:44 -07:00
Joe Wilm eb231b3e70 Log where config was loaded from 2017-09-11 11:12:45 -07:00
Joe Wilm 8990aa4568 Comment about duration arg to file watcher 2017-09-05 09:07:00 -07:00
Joe Wilm 2f095d4096 Reduce file watcher debounce period
500ms introduced a visual lag between file save and display update.
2017-09-05 09:07:00 -07:00
Jonathan Schleußer a7b50e0eb8 Update notify 2017-09-05 09:07:00 -07:00
Jonathan Schleußer a3d35ec185 Update most remaining deps 2017-09-05 09:07:00 -07:00
Jonathan Schleußer 967393a31c Update servo 2017-09-05 09:07:00 -07:00
vale981 556edd82bc A (very) little english fixup... (#770) 2017-09-05 08:56:32 -07:00