3 ms·
I would not do that to your own REPL unless you are really serious about it, with good documentation, escaping, etc... What if there is a file named "~"? What
by GuB-42 2y ago
I would not do that to your own REPL unless you are really serious about it, with good documentation, escaping, etc...
What if there is a file named "~"? What about "~username"? How do you escape/quote it? What if $HOME is not set, or set to something different than the actual user home directory? What about Windows? Also, a lesser known fact is that typing "~." after newline in ssh will force close the connection from the client side and there is nothing the server can do about it, so don't make it part of your workflow.
- remram 2y agoIt's even worse than that, there are others, much more likely key combinations that are interpreted by the SSH client. For example "~v" increases the verbosity of the SSH client, "~C" opens a command line, etc. Entering "~vicky/doc.txt" or "~Ricky/doc.txt" over SSH will actually only write "icky/doc.txt", and entering "~Chris/doc.txt" will have SSH print out it's internal command-line's usage instructions in the middle of the TUI. Screenshot from Vim: https://imgur.com/a/NCt0G9r https://imgur.com/a/NCt0G9r
- BenjiWiebe 2y agoThat is only after a newline, so if you typed 'cat' before the filename, for instance, it would work just fine.