aboutsummaryrefslogtreecommitdiff
path: root/src/term/mod.rs
AgeCommit message (Collapse)Author
2017-01-07Merge pull request #216 from mbrumlow/better_bounds_checkingJoe Wilm
Better bounds checking.
2017-01-07Changes requested.Michael Brumlow
- Rename wrap to input_needs_wrap and providing documentation. - Standardize on min. - Optimization on subtracting col.
2017-01-07Fixing resize crashes.Michael Brumlow
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-07Removing stale comment.Michael Brumlow
2017-01-07Implementing line wrapping.Michael Brumlow
This implementation of line wrapping ensures self.cursor.col is never out of bounds, thus not requiring checking.
2017-01-07Better bounds checking.Michael Brumlow
- 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-07Fixes a slew of bounds issues.Michael Brumlow
2017-01-06Clippy fixes!Manish Goregaokar
2017-01-06Add `nightly` feature, use for `unlikely` intrinsicManish Goregaokar
2017-01-06Remove need for inclusive rangesManish Goregaokar
2017-01-06Remove need for range_contains featureManish Goregaokar
2017-01-06Remove need for step_by featureManish Goregaokar
2017-01-06Handle invalid gotos more gracefully.Josh Leverette
2017-01-01Add support for SGR mouse reportingJoe Wilm
According to: http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking
2016-12-29Improve RenderableCellsIter performanceJoe Wilm
Also adds a benchmark for cell.reset().
2016-12-29Add Default impl for CellJoe Wilm
Just a bit of cleanup.
2016-12-29Fix pty read sometimes not triggering drawJoe Wilm
There was a lot of complexity around the threadsafe `Flag` type and waking up the event loop. The idea was to prevent unnecessary calls to the glutin window's wakeup_event_loop() method which can be expensive. This complexity made it difficult to get synchronization between the pty reader and the render thread correct. Now, the `dirty` flag on the terminal is also used to prevent spurious wakeups. It is only changed when the mutex is held, so race conditions associated with that flag shouldn't happen.
2016-12-29Fix some bugs with selectionsJoe Wilm
Moving the window on macOS would cause a panic in certain circumstances.
2016-12-29Unify Cursor, Location and name it PointJoe Wilm
2016-12-29Fix selection copy for long linesJoe Wilm
Long lines were previously broken at the terminal width. Now, a wrapping marker is kept on the final cell so that extra newlines are not inserted.
2016-12-26Implement copying selection for macOSJoe Wilm
Still need automatic loading into selection copy buffer for linux.
2016-12-22Implement visual component of mouse selectionsJoe Wilm
This adds the ability to click and drag with the mouse and have the effect of visually selecting text. The ability to copy the selection into a clipboard buffer is not yet implemented.
2016-12-16Misc formatting fixesJoe Wilm
2016-12-16Rustup and clippyJoe Wilm
All of the changes in this commit are due to clippy lints.
2016-12-15Handle overflow in Term::move_backwardJoe Wilm
Resolves #25
2016-12-12Remove need for Rc<RefCell<_>> usageJoe Wilm
This adds a trait OnResize and a separate method handle_resize to the display. Instead of having a callback to receive resize events, a list of &mut OnResize are passed to this new method. Doing this allowed the only RefCell usage in the codebase to be removed :).
2016-12-11Track terminal cells on mouse movementJoe Wilm
The cell under the cursor is now tracked in the input processor at `self.mouse.line` and `self.mouse.column`. This could probably be optimized to only compute the cell when in certain states, but the calculation is cheap.
2016-12-11Display manages window, renderer, rasterizerJoe Wilm
This is part of an ongoing decoupling effort across the codebase and tidying effort in main.rs. Everything to do with showing the window with a grid of characters is now managed by the `Display` type. It owns the window, the font rasterizer, and the renderer. The only info needed from it are dimensions of characters and the window itself for sizing the terminal properly. Additionally, the I/O loop has access to wake it up when new data arrives.
2016-12-11Implement Handler::identify_terminal for TermJoe Wilm
The identify_terminal function signature had to change to support writing to the terminal before processing additional input.
2016-12-11Add support for indexed colorsJoe Wilm
ANSI escape sequences like `\x1b[48;5;10m` were not supported until now. Specifically, the second attribute, 5, says that the following attribute is a color index. The ref tests were updated since `enum Color` variants changed.
2016-12-11Add support for bracketed pasteJoe Wilm
Binding/Action execute now has access to TermMode to support bracketed paste mode.
2016-12-11Move term::cell module to its own fileJoe Wilm
The cell module was previously implemented within term.rs. Now each module has its own file.