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
Clear URL when clearing terminal #170
Conversation
The terminal also gets cleared when hitting If I can find out how to catch that, then I'll add that, too. |
web/index.html
Outdated
updateUrl("/"); | ||
term.clear(); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sharkdp The issue with removing the leading The problem does not occur if you serve the folder with an actual web server instead of just opening the file. I think you need to decide here if a working clear is more important, or being able to open the web page without a web server. |
Oops. I was too quick with merging, sorry 😄
If there is no way to extract the base url ( |
Since you're already using |
I tested a few things and this worked for me, too: // This resets the URL when opening the app as a file
history.replaceState(null, null, "index.html") We can distinguish a local file from a web server by checking location.href If you want to go with that instead |
I think we could store var origin = location.href; and then simply revert to that when |
Yea that. You can't directly revert to it since the history API only accepts relative paths, but it does contain the necessary info to make it work. Want a PR? 😄 |
Hm, it seems to be okay if the base URL is still the same. But that might be just Chrome. |
You are right. What it actually doesn't accept is a URL with a different domain. |
Follow-up of #169