mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
term: support for urls in fish
cc @paulirish
This commit is contained in:
parent
01689af952
commit
222064fd03
1 changed files with 6 additions and 0 deletions
|
|
@ -48,6 +48,7 @@ hterm.Keyboard.prototype.onKeyPress_ = function (e) {
|
||||||
const domainRegex = /\b((?=[a-z0-9-]{1,63}\.)(xn--)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,63}\b/;
|
const domainRegex = /\b((?=[a-z0-9-]{1,63}\.)(xn--)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,63}\b/;
|
||||||
const bashRegex = /(ba)?sh: ((https?:\/\/)|(\/\/))?(.*): ((command not found)|(No such file or directory))/;
|
const bashRegex = /(ba)?sh: ((https?:\/\/)|(\/\/))?(.*): ((command not found)|(No such file or directory))/;
|
||||||
const zshRegex = /zsh: ((command not found)|(no such file or directory)): ((https?:\/\/)|(\/\/))?([^\n]+)/;
|
const zshRegex = /zsh: ((command not found)|(no such file or directory)): ((https?:\/\/)|(\/\/))?([^\n]+)/;
|
||||||
|
const fishRegex = /fish: Unknown command '((https?:\/\/)|(\/\/))?([^']+)'/;
|
||||||
|
|
||||||
export default class Term extends Component {
|
export default class Term extends Component {
|
||||||
|
|
||||||
|
|
@ -121,6 +122,11 @@ export default class Term extends Component {
|
||||||
match = data.match(zshRegex);
|
match = data.match(zshRegex);
|
||||||
if (match) {
|
if (match) {
|
||||||
url = match[7];
|
url = match[7];
|
||||||
|
} else {
|
||||||
|
match = data.match(fishRegex);
|
||||||
|
if (match){
|
||||||
|
url = match[4];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue