Comments (12)
@meandmymind Would it help if I added something like this to the README? (which maybe should become a user manual one day) I'm not implying that you need all these definitions explained! Trying to make it clear to as many people as possible.
Glossary
- terminal emulator: a graphical application that mimics an old-fashioned text terminal. You run a shell in a terminal emulator (e.g. iTerm2, Terminal.app, Windows Terminal, Gnome Terminal, Konsole, Alacritty, are terminal emulators)
- shell: an application that displays a prompt, at which you can run command line applications (e.g. bash is an example shell)
- command-line application: an application that you run by typing its name at a shell prompt with some arguments. It takes in text, and outputs text. Sometimes the text can have special color codes in it to make the terminal emulator print the text in color.
- pager: a command line application for displaying any sort of text one screenful at a time (e.g. less is a pager)
- less: the standard pager that is used in linux and unix environments.
less
is suitable for paging any sort of input. - bat: a command line program for displaying source code with syntax highlighting.
bat
sends its output toless
for paging - delta: a command line program for displaying specialist file formats such as git, diff, grep, and git blame output, with code syntax highlighting.
delta
also sends its output toless
for paging - environment variable: a variable that you can set in your shell session
PAGER
: an environment variable that can be used to specify the way you want programs to call less, when those programs need to do paging. For example you could doexport PAGER="less -R"
to set this variable:-R
tellsless
to display colors when its input contains color codes.BAT_PAGER
: an environment variable that you can set to tellbat
to callless
differently from the way other programs callless
DELTA_PAGER
: an environment variable that you can set to telldelta
to callless
differently from the way other programs callless
LESS
: an environment variable that you can set to specify the default argumentsless
should be called with. (Yes, at this point things have got a bit convoluted! You probably want to ignore this one.)
Tips
- You don't need to set any environment variables unless doing so fixes a problem for you!
- Type
env
to print out a list of the environment variables you have set, to check thatPAGER
,BAT_PAGER
,DELTA
,LESS
are not set or, if they are set, that they have sensible values.
from delta.
If we added a command line option allowing the user to specify how many columns they want delta to use when filling right to the edge of the terminal, do you think that would solve your problem? I haven't fully thought it through, but I did skim your so-fancy/diff-so-fancy#271. Are you seeing the same problem with the background colors extending onto the next line, or just the ruler?
from delta.
The background colors also run.
I think it would fix it. I'd be willing to test it out, since I use Rust and can install a branch from git to try it.
from delta.
OK great, it's on the list. (This would also make a good first issue for anyone who wants a fairly doable Rust task.)
from delta.
Hi @alok, this should be fixed in master
: the background colors now adapt dynamically to the terminal width (see 5b26209) and the horizontal decoration lines now respect the --width
option.
from delta.
I'm still having this.
Have bat as $PAGER and $DELTA_PAGER
when I do git diff | delta | bat
it's ok
when I do just git diff
with delta set as pager, line is shifted by this line number column
from delta.
Hi @meandmymind, you can solve this by setting delta width
to a negative value, which means auto-detected width minus $value, e.g.
[delta]
width = -9
I'm sorry this wasn't documented. The reason was slightly ridiculous -- somehow the wrong sort of comments had got onto two lines of the cli.rs
modules, so that the relevant two lines of documentation didn't appear in the --help
output... So thanks for alerting me to that. Fixed in 5ea8dfc and --help
output is in README.
from delta.
hi @dandavison that's cool!
but why is it happening? I don't have any less
and bat
configuration in my system, so "minusing 7" should be default behaviour?
from delta.
It's because you've got DELTA_PAGER=bat
. I didn't say anything because I thought it was deliberate, but tbh I did think it was a strange choice :) If you have PAGER=bat
then you should set DELTA_PAGER
to something like less -R
.
from delta.
@dandavison ok it means I don't understand this paging stuff but changing DELTA_PAGER
to less -R
worked :))) thanks
from delta.
So to be explicit, what the above glossary is meant to show is that it doesn't make sense to set DELTA_PAGER=bat
for the following reason: that would mean that delta
sends its output to bat
. But delta
's output is (typically) in a format which is like diff format but maybe with extra boxes and lines and things, and the code has already been syntax highlighted, whereas bat
is expecting source code in some programming language. So bat
won't do anything helpful with delta
's output. But will bat
do anything undesirable with delta's output? Not if you call it as bat --plain
, but by default bat
will put delta
's output inside ruled margins with line numbers, and that is unlikely to be what you want. In conclusion, less
is the appropriate program to use for DELTA_PAGER
. But delta
uses less
by default so you don't need to set DELTA_PAGER
unless you have a particular problem that it would solve.
from delta.
@dandavison It just wasn't clear to me the relation between delta and bat. Now with your explanations it's much clearear. Thanks!
from delta.
Related Issues (20)
- Show filename when using `git blame -CCC` 🚀
- Commit hyperlink not working 🐛
- 🐛 git-grep path output is often replacing "/" with ":" HOT 1
- RUSTSEC-2023-0081: safemem is unmaintained
- 🐛 Delta doesn't highlight matches if `color.grep.match` changed
- Remove empty lines around filename 🚀
- 🐛 Possible race condition in delta testsuite with environment variable setting
- 🚀 Consider making README.md mention that color settings in .gitconfig can override delta's colors
- 🐛 Docu: Build instructions incomplete
- 🐛 Docu: Link to repo?
- 🐛 Delta on Windows doesn't use .gitconfig file HOT 1
- allow to completely omit zero ("same") lines (like `diff -U0` would do) HOT 6
- 🐛 Delta sometimes duplicates diff entries HOT 1
- 🐛 Colours different on different systems. HOT 1
- 🐛 Delta as `diffFilter` breaks keyboard input with `git add -p` in Git CMD HOT 12
- 🐛 delta fails to build with enabled `lto` HOT 1
- 🐛 Incorrect use of bright-black background with native less pager on Windows
- 🚀 New binary release please! HOT 2
- Regression in highlighting from #1037 HOT 5
- 🐛 test env::tests::test_env_parsing_with_pager_set_to_bat ... FAILED HOT 4
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 delta.