Skip to content
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

Sublime expands file name to absolute path #1573

Closed
1 task done
KES777 opened this issue Jan 18, 2017 · 9 comments
Closed
1 task done

Sublime expands file name to absolute path #1573

KES777 opened this issue Jan 18, 2017 · 9 comments

Comments

@KES777
Copy link

KES777 commented Jan 18, 2017

$ pwd
/home/kes/a
$ pwd -P
/home/kes/work/projects/art
$ /opt/sublime_text/sublime_text Makefile
# Opens file as: /home/kes/work/projects/art/Makefile  # NOT EXPECTED
$ /opt/sublime_text/sublime_text ~/a/Makefile
# Opens file as: /home/kes/a/Makefile

Sublime should use current folder instead of absolute path.

Implement option to expand absolute path if someone need one

Environment

  • Operating system and version:
    • Linux Mint 18.0
  • Sublime Text:
    • Build 3126
@KES777 KES777 changed the title Sublime expand file name to absolute path Sublime expands file name to absolute path Jan 18, 2017
@FichteFoll
Copy link
Collaborator

FichteFoll commented Jan 19, 2017

Sublime Text does not treat the working directory in any special way, because a ST session is both directory- and file-independant. I.e. you can open multiple files in a single ST process and they can be any files in your file system. As such, it would make little sense to show only relative paths to the working directory because that makes ST behave inconsistent.

The only part where the working directory matters is when opening files or folders from the commandline, which you displayed as working correctly.

@KES777
Copy link
Author

KES777 commented Jan 19, 2017

do not understand. Why if file is opened from directory xxx is showed as it is opened from directory yyy

@KES777
Copy link
Author

KES777 commented Jan 19, 2017

In any case sublime get absolute path. That is right and it should be done. As you said:

they can by any files in your file system

But it is not expected that it resolves sym links too

@FichteFoll
Copy link
Collaborator

FichteFoll commented Jan 26, 2017

Your issue is most likely #1548 (#151) then.

I heard that symlink behavior (in the sidebar) might receive some improvements for the next release.

@KES777
Copy link
Author

KES777 commented Jan 26, 2017

I did not found follows_symlinks option in my configuration files. Neither at preferences nor project settings.

I do not think this issues belongs to the referred one. But I agree that this is some problem with symlinks

@KES777
Copy link
Author

KES777 commented Oct 2, 2017

Hi. again. I have found this doc

Doc says:

The path may be relative to the project directory, or a fully qualified path

but did not answer:

  1. How to setup project directory?
  2. How to setup option follow_symlinks without configuring each directory in project root?

Please explain or update doc. thank you.

@KES777
Copy link
Author

KES777 commented Oct 2, 2017

it would make little sense to show only relative paths to the working directory because that makes ST behave inconsistent.

It would make sense to show relative path the project root. It really makes sense here.

The only part where the working directory matters is when opening files or folders from the commandline, which you displayed as working correctly.

No, it works incorrect

The expected path is: /home/kes/s/lib/App/Schema/Result/Payment.pm
and not /home/kes/work/projects/safevpn/repo2/lib/App/Schema/Result/Payment.pm

absolute_path

So. When sublime text is given relative path and invoked from command line
it should use current path AS IS and should not drop symlinks from it/convert it to physical path

@KES777
Copy link
Author

KES777 commented Oct 11, 2017

Also path is significant because most of time (exept browser and sublime text) I work in console.
I think, it will be also significant for people who work in console too

@KES777
Copy link
Author

KES777 commented Oct 11, 2017

I dig a bit and the problem maybe with pwd. Just compare:

~/s/lib $ echo $PWD
/home/kes/s/lib
 ~/s/lib $ /bin/pwd
/home/kes/work/projects/safevpn/repo2/lib

So when sublime text is given relative file name and you turn it into absolute. You should use value from PWD environment variable instead of run pwd command.

Hope this will help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants