Skip to content

Make cd_on_quit more cross platform and more clean. #706

@lazysegtree

Description

@lazysegtree

Original idea by @wassup05 on #696


I was trying to integrate the --print-last-dir option which was added in #488 so that this can become cross-platform similar to how lf does it but was unable to... Anyone has any ideas for that?


Further conversation

@wassup05 I tried something like this. But this doesn't seem to be working. SPF ui doesn't shows up. and cd is also not working.
I will try to dig around a bit more on this. But it should be possible.

➜  ~ [10:46:39] DIR=$(spf --print-last-dir); echo "DIR is $DIR"; cd $DIR
DIR is /Users/kuknitin
cd: file name too long: ^[[?25l^[[?1049h^[[2J^[[H^[[?25l^[[?2004h^[[?1002h^[[?1006h^[]2;SuperFile^G^[[H^M Terminal size too small: ^M\n   Width = 0 Height = 0   ^M\n                          ^M\nNeeded for current config:^M\n  Width = 60 Height = 24  ^[[5;H^[[2K^M^[[?2004l^[[?25h^[[?1002l^[[?1003l^[[?1006l^[[?1049l^[[?25h/Users/kuknitin
➜  ~ [10:46:53]

Originally posted by @lazysegtree in #696 (comment)


We could have some args in spf path-list command like

 spf path-list --last-dir
 spf path-list --log-file

Then this could work

DIR=$(spf path-list --last-dir); spf; source $DIR

Note : Link to lf's approach - https://github.com/gokcehan/lf/wiki/Tips#quit-without-changing-directories-when-using-lfcd

Originally posted by @lazysegtree in #696 (comment)


yeah that will work, that is how yazi does it using it's --cwd-file argument. If I had to guess the previous approach (like that of lf) not working is more related to the underlying bubbletea library than superfile in itself

Originally posted by @wassup05 in #696 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthigh priorityIssue/PR/Feature/bug that is considered high priority.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions