Shell: Attach links to completed paths

```
ls ./Ter<tab>
```
gets you a link to ./Terminal.ini, right in the prompt.
This commit is contained in:
AnotherTest 2020-05-18 02:27:41 +04:30 committed by Andreas Kling
parent 88f542dc30
commit 5358608a94
Notes: sideshowbarker 2024-07-19 06:17:46 +09:00

View file

@ -1578,9 +1578,9 @@ Vector<Line::CompletionSuggestion> Shell::complete(const Line::Editor& editor)
if (!stat_error) {
if (S_ISDIR(program_status.st_mode)) {
if (!should_suggest_only_executables)
suggestions.append({ escape_token(file), "/" });
suggestions.append({ escape_token(file), "/", { Line::Style::Hyperlink(String::format("file://%s", file_path.characters())), Line::Style::Anchored } });
} else {
suggestions.append({ escape_token(file), " " });
suggestions.append({ escape_token(file), " ", { Line::Style::Hyperlink(String::format("file://%s", file_path.characters())), Line::Style::Anchored } });
}
}
}