Open valkheim opened 5 years ago
New feature:
This allows the user to customize the prompt. url is parsed and formatted with the urlparse conventions.
Default configuration:
Default configuration is using the whole url (scheme, netloc, path, params, query, fragment): prompt = '{scheme}{netloc}{path}{params}{query}{fragment}'
prompt = '{scheme}{netloc}{path}{params}{query}{fragment}'
Example:
$ tail -n 1 ~/.config/http-prompt/config.py prompt = '{netloc[1:]}{path[-2:]}' $ http-prompt "http://www.example.org" Version: 1.0.0 example.org/> cd foo/bar/baz example.org/bar/baz> Goodbye!
Possible updates:
{path}
/foo >
/foo
{path[-2:][1]}
/f/b>
moo/foo/bar
I might be not good enough with python to ensure myself I didn't introduced a vulnerability through eval() in utils.get_prompt().
eval()
utils.get_prompt()
Related issue
New feature:
This allows the user to customize the prompt. url is parsed and formatted with the urlparse conventions.
Default configuration:
Default configuration is using the whole url (scheme, netloc, path, params, query, fragment):
prompt = '{scheme}{netloc}{path}{params}{query}{fragment}'
Example:
Possible updates:
{path}
will give/foo >
from a/foo
path{path[-2:][1]}
will give/f/b>
from amoo/foo/bar
pathI might be not good enough with python to ensure myself I didn't introduced a vulnerability through
eval()
inutils.get_prompt()
.Related issue