Comments (5)
With a debug build I get a more maningful error and backtrace:
3: difft::display::side_by_side::SourceDimensions::new
at ./src/display/side_by_side.rs:185:31
That's
let lhs_total_width = (terminal_width - SPACER.len()) / 2;
When running in eshell, terminal_width
is 0 and SPACER.len() is
positive, hence the overflow.
AFAICT, terminal_width
is 0, because in detect_display_width
in ./src/options.rs:864
there's
if let Ok((columns, _rows)) = crossterm::terminal::size() {
When running in eshell, crossterm::terminal::size()
returns Ok, but
with colums and rows both 0.
So the cause is that crossterm cannot correctly determine the size of
the terminal in eshell. The best fix is probably to fix crossterm, but
as a workaround, difftastic could check for a 0 width here and fall back
on e.g. looking at the COLUMNS
environment variable which is set
correctly in eshell or the default value of 80.
from difftastic.
Could you share the files that caused this issue?
from difftastic.
Hi @Wilfred
I attach a.el and b.el which will lead a crash message in my local with eshell inside emacs.
test.TGZ
$ emacs -nw -q # and start eshell
/tmp $ difft a.el b.el
b.el --- Emacs Lisp
File permissions changed from 100664 to 100600.
memory allocation of 9223372036854775804 bytes failed
aborted
from difftastic.
Reported upstream: crossterm-rs/crossterm#891
from difftastic.
Thank you all for the great works!
from difftastic.
Related Issues (20)
- Provide automatic display options that consider terminal width, etc.
- Error: "index out of bounds: the len is 20 but the index is 20" HOT 4
- Unchanged HTML reported as changed HOT 1
- No option to diff hidden files in directories HOT 1
- Word differ returns out-of-bounds column numbers HOT 1
- tree-sitter-lua is out-dated
- index out of bounds: the len is X but the index is X', src/display/inline.rs:115:21
- Bad error recovery from (incorrect) C preprocessor error
- Inline diff is ignoring unchanged lines between hunks
- "index out of bounds" error, panic in side_by_side.rs HOT 2
- Output file paths as relative to current working directory
- Feature Request: Compare Subdirectories, ignore directory name difference
- Elm diff shows no syntactic changes for changes to doc comments
- `--language` command line argument is not supported
- difft does shows single/double quote as a diff for python HOT 3
- Include line number in patch diff header
- difftastic do not show color in fzf preview
- Dynamic sublanguages (injections)
- [Question] Want to know the changes in the AST nodes of the old and new files? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from difftastic.