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

Add support for shell #1320

Closed
paladox opened this issue Mar 1, 2018 · 7 comments
Closed

Add support for shell #1320

paladox opened this issue Mar 1, 2018 · 7 comments

Comments

@paladox
Copy link
Contributor

paladox commented Mar 1, 2018

Hi, could support for the shell language be added please?

@Golmote
Copy link
Contributor

Golmote commented Mar 1, 2018

Isn't it the same thing as bash?

@paladox
Copy link
Contributor Author

paladox commented Mar 1, 2018

@Golmote Kind of, but looking at https://github.com/isagalaev/highlight.js/blob/master/src/languages/shell.js#L14 it may have slightly different syntax for some things

So this lang could extend bash.

@paladox
Copy link
Contributor Author

paladox commented Mar 1, 2018

@Golmote actually, it seems it checks for #/bin/bash and /bin/sh in the bash file so i will just add shell as the alias for bash.

see #1321

Golmote pushed a commit that referenced this issue Mar 1, 2018
* Add Prism.languages.shell to bash file as an alias

Fixes #1320
@juancampa
Copy link

juancampa commented Nov 7, 2018

@paladox, highlight's shell is not just bash. It's to highlight interactive shell sessions where commands lines start with $. Like the following:

$ cd dir
$ ls
file1/ file2

Which is not bash but if a line starts with /[$%#>]/, then the rest is bash, otherwise, it's plain text (e.g. the output of ls).

@mAAdhaTTah
Copy link
Member

@juancampa There's a command-line plugin that may suit your needs.

@whitemuu
Copy link

@juancampa There's a command-line plugin that may suit your needs.

That looks great. The sad thing is that it can't be used in node. Still wanting a special lang named shell-session or command-line.

@FranklinYu
Copy link

FranklinYu commented May 15, 2019

@whitemuu I created an issue for it: #1891. I don’t think the plugin is a valid replacement for language definition.

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

6 participants