Skip to content

Commit

Permalink
Basic functionality still works even if the shell isn't setting windo…
Browse files Browse the repository at this point in the history
…w titles
  • Loading branch information
chendo committed Apr 3, 2011
1 parent 87aa895 commit 922081b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
5 changes: 5 additions & 0 deletions PTYTextView.m
Original file line number Diff line number Diff line change
Expand Up @@ -5682,6 +5682,11 @@ - (void)logWorkingDirectoryAtLine:(long long) line {
}

- (NSString *)getWorkingDirectoryAtLine:(long long) line {
// Return current directory if not able to log via XTERMCC_WINDOW_TITLE
if ([workingDirectoryAtLines count] == 0) {
return [[dataSource shellTask] getWorkingDirectory];
}

long long previousLine = [[[workingDirectoryAtLines lastObject] objectAtIndex:0] longLongValue];
long long currentLine;

Expand Down
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,21 @@ You can also use Command + drag and it will turn it into a draggable
file handle, which you can drop in any OSX app. Pretty rad, no?

## Instructions
Just [Download](https://github.com/chendo/iTerm2/archives/master) (or build your own,
if you're paranoid or you want the newest features), and off you go!
[Download](https://github.com/chendo/iTerm2/archives/master) (or build your own,
if you're paranoid or you want the newest features).

Works with MacVim, Textmate and BBedit (it searches for editor in that
order)

If you want it to work even when changing between directories, your
shell must set a window title every time your prompt shows up. I'm using
this as a hook cause it seemed the most appropriate. If you
have oh-my-zsh, then it works out of the box.

Other zsh users, see [termsupport.zsh](https://github.com/robbyrussell/oh-my-zsh/blob/master/lib/termsupport.zsh).

Other shell users, see [here](http://www.faqs.org/docs/Linux-mini/Xterm-Title.html#toc4).

## Operation
* Command + Click opens the file if it is text in
MacVim/Textmate/BBedit, otherwise opens with associated program.
Expand All @@ -37,6 +46,7 @@ receive the full path and the line number (if any) as arguments.
## Cavets
* Does not work with paths with spaces (for now).
* No configuration options (for now).
* Changing support doesn't work out of the box.

## Known issues
* Drag detection is way too sensitive. Even one pixel makes it think
Expand All @@ -52,6 +62,9 @@ receive the full path and the line number (if any) as arguments.

## Changelog

### alpha 3:
* Basic functionality still works if shell isn't setting window title

### alpha 2:
* Now works when the working directory is not valid for old paths in the
buffer
Expand Down

0 comments on commit 922081b

Please sign in to comment.