Commit Graph
291 Commits
Author SHA1 Message Date
jc00ke 9f064001e2 Load the primary clipboard when pasting
Paste & PasteSelection are not quite the same. The former should be
pulling from the main clipboard where the latter does not.
2017-01-30 07:30:46 -08:00
Joe Wilm 6d744abf7b Update to serde 0.9 and serde-yaml 0.6. 2017-01-29 17:29:56 -08:00
Danny Dulai e04584b082 support for inverting the cursor or using colors 2017-01-29 16:06:29 -08:00
Niklas Claesson 019daa8b69 Add support for -e argument 2017-01-28 12:25:57 -08:00
Joe Wilm 08f348ecea Optimize glyph cache access
Loading a glyph from the cache is a very hot operation in the renderer.
The original implementation would first check if a glyph was loaded and
then call `get()` which would have to search a second time. This showed
up as a very slow point in profiles.

This patch addresses glyph cache access in two ways: by using a faster
hasher optimized for small keys (fnv), and by using the entry API for
fetching a cached glyph. The `fnv` hasher is faster than the default and
is very efficient for small keys. Using the entry API on the HashMap
means only 1 lookup instead of two. The entry API has a downside where
the key needs to get cloned on fetches.

Reducing the GlyphKey width to 64-bits helps in both areas. Copying an
8-byte wide type is very cheap and thus limits downside of the entry
API. The small width also helps with the hasher performance.

Over all, this patch reduced typical render times by several hundred
microseconds on a 2013 MacBook Pro with a full screen terminal full of
text.
2017-01-26 08:43:53 -08:00
Niklas Claesson 04c5ad372a Implement argument passing in config
This commit implements the following syntax in the config file:

```yaml
shell:
  program: /bin/bash
  args:
    - --login
    - --norc
```
2017-01-25 08:50:28 -08:00
Kurnevsky Evgeny 1dca5617e2 Use clap as cli parser. 2017-01-24 08:38:38 -08:00
Niklas Claesson 6e51e9e27b Change to process::Command 2017-01-23 21:08:00 -08:00
Joe Wilm e118431d16 Remove debug_print! macros
The logging macros should be used instead.
2017-01-23 09:14:01 -08:00
Joe Wilm ee37dc86ab Return an error from logging::initialize
Logging initialization now shares the same error handling code as the
rest of the `run` function.
2017-01-23 09:14:01 -08:00
Joe Wilm abd3958cb5 Minor formatting fixes 2017-01-23 09:14:01 -08:00
Joe Wilm db5f65637a Changes to Logger logic
The logger implementation will now only show items from Alacritty.
Additionally, the module info is omitted from the log output. If the
origin of a log item must be found, it can easily be grepped for.
2017-01-23 09:14:01 -08:00
Lukas Lueg 64b42cd2f3 Use the log-crate instead of printing to stdout 2017-01-23 09:14:01 -08:00
Steven Fackler 41f99dc4c0 Dynamically generate test harness
This uses the rustc-test crate, a copy of the standard test crate, to
dynamically create tests for each reference test. No need to remember to
update the macro, just add the directory to ref!
2017-01-23 08:59:54 -08:00
Richard Palethorpe 6229477190 ansi: Designate and invoke graphic character sets
Implement the designation of graphic character sets G0-G3 to ASCII or the
Special character and line drawing glyphs. As well as the invokation/selection
of the character sets (shift in, shift out and lock shifting).
2017-01-21 12:09:21 -08:00
Oula Kuuva 77f95f1477 Remove unnecessary feature
Proc_macro has been stable since 1.15.0, attribute no longer needed.
2017-01-18 22:28:46 -08:00
johalun 398e31fa37 Make it run on FreeBSD 2017-01-18 22:28:16 -08:00
Joe Wilm a2cd4b647c Cleanup getpwuid_r wrapper
The wrapper had some transmutes still from an earlier implementation,
and they are not needed now.
2017-01-15 16:39:22 -08:00
Tom Crayford f85cc353a6 make thin stroke rendering configurable
Makes thin stroke rendering for darwin configurable by a new toplevel
key under `font:` in the config file. Defaults to false, has no impact
on non macos.
2017-01-12 21:19:40 -08:00
Michael Brumlow 06d213fbc7 Proposal for line wrap - ^[[7h and ^[[7l (private)
These changes provide support for disabling auto line wrap which is
currently default to on.

'tput rman' will now disable auto line wrap and alacritty will now not
automatically wrap lines.

'tput sman' will now (re)enable auto line wrap and alacritty will now
automatically wrap lines once it reaches the end of the line.

My testing showed this to work the same as gnome-terminal.

I should note that simply having ^[[7h or ^[[7l in a recording does not
enable and disable line wrapping. This is the same behavior as
gnome-terminal and xterm. Those cape codes come through as private
which are not handled yet. I behave this is the correct behavior.
2017-01-11 22:10:48 -08:00
Joe Wilm a7fc46afce Fix bug where event loop could get stuck reading
One symptom of this bug was being unable to send C-c during `cat
/dev/urandom`.

cc #271
2017-01-11 10:33:56 -08:00
Joe Wilm dfb1b3bb5c Add support for setting title from OSC
Resolves #23
Resolves #144
2017-01-11 09:07:31 -08:00
Joe Wilm 6656df1401 Fix last panic with cat /dev/urandom 2017-01-09 23:10:12 -08:00
Michael Brumlow b99fda5214 Fixing panic on cat /dev/urandom
- Checks to make sure lines count coming from the pty are within a proper
range before doing scrolling.

- Sanitizes scroll region when being set.

- Changes panic for unimplemented screen clear to a print statement.

The first two changes ensure scrolling won't crash us. By sanitizing the
region on set we don't have to complicate the scroll code with limits,
mins, or maxes to ensure the scroll operation is within the range.
Checking if the lines is greater than the total region allows us to
simply clear the region and avoid subtracting large numbers from small
ones.
2017-01-10 00:57:49 -06:00
Alberto Corona c314fb25cd Add another optional config path $HOME/.alacritty.yml
- Added note about the default file created if no path is found
2017-01-09 09:23:32 -08:00
Alberto Corona 929403386c Support config path $XDG_CONFIG/alacritty.yml
- Update README to reflect changes
2017-01-09 09:23:32 -08:00
Alberto Corona 987b8555de Conform to XDG spec for configuration
- Use $XDG_CONFIG_HOME/alacritty/alacritty.yml for loading the
	  configuration file falling back to $HOME/.config/alacritty/alacritty.yml
	- Closes #203
2017-01-09 09:23:32 -08:00
Joe Wilm 2fa271419c Merge pull request #236 from tcrayford/print_glutin_events
print glutin events if --print-events is passed
2017-01-08 21:43:27 -08:00
Joe Wilm 9e856bc9d2 Remove some dead code 2017-01-08 17:08:52 -08:00
Joe Wilm b7f43ac023 Fix parsing of coalesced SGR attributes
cc #116
2017-01-08 16:35:59 -08:00
Tom Crayford d7a5981048 print glutin events if --print-events is passed
When debugging many issues, it's often very helpful to have the raw
glutin events printed out to stderr as they come in. This does that.

Note that since `glutin::Event` doesn't implement `Display`, we just use
rust's debugging output for now via `{:?}`.
2017-01-08 21:09:02 +00:00
Joe Wilm 9e713189cc Merge pull request #216 from mbrumlow/better_bounds_checking
Better bounds checking.
2017-01-07 21:24:55 -08:00
Michael Brumlow 5642624f40 Changes requested.
- Rename wrap to input_needs_wrap and providing documentation.
- Standardize on min.
- Optimization on subtracting col.
2017-01-07 21:46:02 -06:00
Michael Brumlow fb56dcbad9 Fixing resize crashes.
Most of the crashes on resize were due to columns and lines being set to
zero. This causes all sorts of other checks within the code to ensure
these values are greater than zero before running calculations. To avoid
this we just need to ensure that lines and columns are some non zero
value. This is seems to be what gnome terminal does. I have selected
2 lines and two columns for min terminal size for now.
2017-01-07 18:07:03 -06:00
Michael Brumlow c106ee6601 Removing stale comment. 2017-01-07 17:17:46 -06:00
Michael Brumlow 24453fa698 Implementing line wrapping.
This implementation of line wrapping ensures self.cursor.col is never out
of bounds, thus not requiring checking.
2017-01-07 17:13:42 -06:00
Michael Brumlow b88fd8a23e Better bounds checking.
- Remove the use of limit.
- Reduce the number of comparisons.

When using numbers provided by the PTY for subtractions there is a extra
step of ensuring that we won't trigger failure on testing when trying to
subtract form zero.

** NOTE **

This commit fails fails the tmux_git_log test. I am submitting a PR to
talk about the test. I think the test was generated before a few things
were fixed the final test gird still has cells that should have been
scrolled off the screen. Also, comparing output from gnome-terminal
there is no difference. So this PR is here to discuss and gather
information on balding test and discussing the possibility that this test
may be flawed.

** NOTE **
2017-01-07 15:47:05 -06:00
Joe Wilm f4b10a1dbb Merge pull request #164 from mbrumlow/fix_bounds
Fixes a slew of bounds issues.
2017-01-07 10:20:01 -08:00
Joe Wilm 56773fe7e7 Merge pull request #138 from honza/master
Add "shell" option to config
2017-01-07 09:46:28 -08:00
Honza Pokorny 962dd61348 Typo 2017-01-07 13:07:06 -04:00
Honza Pokorny 7ed4f205ad Avoid unwrap when determining proper shell to use 2017-01-07 08:43:58 -04:00
Honza Pokorny a01ef5568f Avoid unnecessary closure in a map call 2017-01-07 08:43:34 -04:00
Honza Pokorny e98e6bdf64 Add doc string to 'shell' config option 2017-01-07 08:43:09 -04:00
Michael Brumlow 180150bbc1 Fixes a slew of bounds issues. 2017-01-07 02:06:30 -06:00
Joe Wilm bcd464aeec Fix issue with some international inputs
cc #87, #55
2017-01-06 22:11:54 -08:00
Manish Goregaokar 4e1f4c8cd7 Clippy fixes! 2017-01-06 20:44:51 -08:00
Manish Goregaokar 49187d53f2 Add nightly feature, use for unlikely intrinsic 2017-01-06 20:28:17 -08:00
Manish Goregaokar fbeded8ac5 Remove need for inclusive ranges 2017-01-06 20:28:17 -08:00
Manish Goregaokar c579d07993 Remove need for range_contains feature 2017-01-06 20:17:10 -08:00
Manish Goregaokar ee5a9f1338 Replace need for drop_types_in_const with lazy_static 2017-01-06 20:17:10 -08:00