Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't open Dockerfile or .dockerfile #717

Closed
davidfilat opened this issue Nov 4, 2019 · 7 comments
Closed

Can't open Dockerfile or .dockerfile #717

davidfilat opened this issue Nov 4, 2019 · 7 comments

Comments

@davidfilat
Copy link

I have installed the latest build and tried to open the Dockerfile for my project and it didn't open at all. I mean nothing happened, the prompt just asked me for the next command.
CleanShot 2019-11-04 at 12 57 16@2x

@sharkdp
Copy link
Owner

sharkdp commented Nov 4, 2019

Thank you for reporting this.

Could you please show the output of

ls -l Dockerfile
file Dockerfile
cat Dockerfile

@davidfilat
Copy link
Author

davidfilat commented Nov 4, 2019

Of course. Here they are:
CleanShot 2019-11-04 at 23 08 42@2x
CleanShot 2019-11-04 at 23 07 16@2x
CleanShot 2019-11-04 at 23 07 35@2x

@sharkdp
Copy link
Owner

sharkdp commented Nov 4, 2019

I would guess that something is wrong with your pager. Could you try to run

bat --paging=never Dockerfile

?

To debug this further, could you please show the output of the following script:

set -x

bat --version
bat --config-file
bat --cache-dir
less --version

bat "$(bat --config-file)"
ls "$(bat --cache-dir)"

set +x

echo "BAT_PAGER = '$BAT_PAGER'"
echo "BAT_CONFIG_PATH = '$BAT_CONFIG_PATH'"
echo "BAT_STYLE = '$BAT_STYLE'"
echo "BAT_THEME = '$BAT_THEME'"
echo "BAT_TABS = '$BAT_TABS'"
echo "PAGER = '$PAGER'"
echo "LESS = '$LESS'"

@davidfilat
Copy link
Author

The bat --paging=never Dockerfile command worked and it displayed the text correctly.
I have attached the debugging information you requested below and I hope it will help you fix this issue! Thank you very much, @sharkdp !

/Users/davidfilat/.config/bat/config
/Users/davidfilat/.cache/bat
less 487 (POSIX regular expressions)
Copyright (C) 1984-2016  Mark Nudelman

less comes with NO WARRANTY, to the extent permitted by law.
For information about the terms of redistribution,
see the file named README in the less distribution.
Homepage: http://www.greenwoodsoftware.com/less
# Set the theme to "TwoDark"
--theme="Dracula"

# Show line numbers, Git modifications and file header (but no grid)
--style="numbers,changes,header"

# Use italic text on the terminal (not supported on all terminals)
--italic-text=always

# Add mouse scrolling support in less (does not work with older
# versions of "less")
--pager="less -FR"

# Use C++ syntax (instead of C) for .h header files
--map-syntax h:cpp
# Use "gitignore" highlighting for ".ignore" files
--map-syntax .ignore:.gitignoresyntaxes.bin
themes.bin
BAT_PAGER = ''
BAT_CONFIG_PATH = ''
BAT_STYLE = ''
BAT_THEME = 'Dracula'
BAT_TABS = ''
PAGER = 'less'
LESS = '-R'

@davidfilat
Copy link
Author

@sharkdp I wanted to let you know that installing the Homebrew version of less pager fixed the issue for me. It seems the Less version delivered with Catalina is outdated.
Maybe you could add less as a dependency for the Homebrew formulae and for add to the FAQs the suggestion to update less, for those who struggle with the same problem.
Thank you very much for your help!

@sharkdp
Copy link
Owner

sharkdp commented Nov 5, 2019

The problem is that you added --pager="less -FR" to your bat configuration file. If you remove that line, it would also work with older versions of less (see the comment above that line).

Still, adding less as a dependency for bat might be a good idea for a better UX, but that has to be decided upstream in the Homebrew repository. I'm not personally maintaining the Homebrew package and don't use macOS myself.

@davidfilat
Copy link
Author

Than you very much for your help, @sharkdp! Deeply appreciate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants