dandavison / iterm2-dwim Goto Github PK
View Code? Open in Web Editor NEWiTerm2 click handler
iTerm2 click handler
E.g. z.py
. Would need to ensure that path regexes match a path as simple as that.
Currently a parse rule exists that tries to interpret a relative path as relative to the current directory CWD
.
However, it's fairly common to be in an internal directory of the git repo, and yet be looking at a path in some output that is relative to the root of the git repo. In that situation, no parse rule will cerrently match.
We could add a parse rule that works as follows: ask git
whether CWD
is in a git repo and if so what the root is (git rev-parse --show-toplevel
), and try the path relative to that root.
With the current configuration instructions in the README, absolute paths are handled by iTerm2's "Semantic History"
whereas relative paths are handled by the "Paths" regex in "Smart Selection"
However, the default "Paths" regex that comes with iTerm2 does not capture the trailing text, which is where the line number is to be found, if present. E.g. this python traceback will open on line 1, not line 4 as it should:
$ /tmp mkdir z
/tmp cat > z/z.py
a = 1
b = 2
c = 0
a/c
/tmp python z/z.py
Traceback (most recent call last):
File "z/z.py", line 4, in <module>
a/c
ZeroDivisionError: integer division or modulo by zero
I think the solution will involve
iterm2-dwim
iterm2-dwim
in the README.The default Paths regex that comes with iTerm2 is
\~?/?([[:letter:][:number:]._-]+/+)+[[:letter:][:number:]._-]+/?
So far I've experimented with one variation on this:
Regex: (\~?/?([[:letter:][:number:]._-]+/+)+[[:letter:][:number:]._-]+/?)([^ ]*)
Parameter: /usr/local/bin/iterm2-dwim \1 \3
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.