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

Enable tilde expansion in .tigrc "source" commands #168

Closed
wants to merge 1 commit into from

Conversation

wjv
Copy link

@wjv wjv commented Jul 8, 2013

The examples listed in the SOURCE COMMAND section of tigrc(5) seem to indicate that one can rely on tilde expansion to be applied to the paths of configuration files includes via the "source" command. However, it doesn't seem as if this had ever been implemented.

I've tried to add this functionality here, and it seems to work fine in my tests.

(Thanks to @antoinevg for pointing me in the right direction.)

This is documented as as functioning in the SOURCE COMMAND section of
tigrc(5), but has not actually been implemented.
@jonas
Copy link
Owner

jonas commented Jul 16, 2013

Thanks for the patch @wjv.

I am wondering if either the existence of <wordexp.h> needs to be checked by the configure script or whether we can simply get away with just replace any leading ~/ with $HOME/. I know this is less standards-like, but at least it is guaranteed to work.

Also, ideally the tilde expansion should be done in io_open() so that other parts of tig can benefit from this, such as the expansion of "~/.tigrc", which is currently done manually.

tig/tig.c

Line 1827 in d2058bf

if (!home || !string_format(buf, "%s/.tigrc", home))
.

@jonas jonas closed this in 4cd3ce8 Jul 29, 2013
@jonas
Copy link
Owner

jonas commented Jul 29, 2013

I went ahead and patched this to use the tilde/$HOME expansion already used internally in tig.

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

Successfully merging this pull request may close these issues.

2 participants