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

Add --no-cwd-file to close #1629

Closed
2 of 3 tasks
kockahonza opened this issue Sep 10, 2024 · 9 comments
Closed
2 of 3 tasks

Add --no-cwd-file to close #1629

kockahonza opened this issue Sep 10, 2024 · 9 comments
Labels
feature New feature request good first issue Good for newcomers

Comments

@kockahonza
Copy link

kockahonza commented Sep 10, 2024

yazi --debug output

Yazi
    Version: 0.3.3 (Arch Linux 2024-09-05)
    Debug  : false
    OS     : linux-x86_64 (unix)

Ya
    Version: 0.3.3 (Arch Linux 2024-09-05)

Emulator
    Emulator.via_env: ("xterm-kitty", "")
    Emulator.via_csi: Ok(Kitty)
    Emulator.detect : Kitty

Adapter
    Adapter.matches: Kitty

Desktop
    XDG_SESSION_TYPE           : Some("wayland")
    WAYLAND_DISPLAY            : Some("wayland-1")
    DISPLAY                    : Some(":1")
    SWAYSOCK                   : Some("/run/user/1000/sway-ipc.1000.3960.sock")
    HYPRLAND_INSTANCE_SIGNATURE: None
    WAYFIRE_SOCKET             : None

SSH
    shared.in_ssh_connection: false

WSL
    WSL: false

Variables
    SHELL              : Some("/usr/bin/fish")
    EDITOR             : Some("/usr/bin/nvim")
    VISUAL             : None
    YAZI_FILE_ONE      : None
    YAZI_CONFIG_HOME   : None

Text Opener
    default: Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
    block  : Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })

Multiplexers
    TMUX               : false
    tmux version       : No such file or directory (os error 2)
    ZELLIJ_SESSION_NAME: None
    Zellij version     : No such file or directory (os error 2)

Dependencies
    file             : 5.45
    ueberzugpp       : No such file or directory (os error 2)
    ffmpegthumbnailer: No such file or directory (os error 2)
    magick           : 7.1.1-38
    fzf              : 0.54.3
    fd               : 10.2.0
    rg               : 14.1.0
    chafa            : 1.14.2
    zoxide           : 0.9.4
    7z               : 17.05
    7zz              : No such file or directory (os error 2)
    jq               : 1.7.1


--------------------------------------------------
When reporting a bug, please also upload the `yazi.log` log file - only upload the most recent content by time.
You can find it in the "/home/honza/.local/state/yazi" directory.

Please describe the problem you're trying to solve

As the title says I think it might be worth adding the --no-cwd-file option to the close command as well as quit for when close exits yazi (when it closed the last tab). It's a very small thing but seems reasonable and I could personally use it as I prefer close over quit.

I might be able to implement this myself but not right now as I'm too busy, maybe in a couple of months.

Would you be willing to contribute this feature?

  • Yes, I'll give it a shot

Describe the solution you'd like

Pretty clear from the above I think.

Additional context

No response

Validations

  • I have searched the existing issues
  • The latest nightly build of Yazi doesn't already have this feature
@kockahonza kockahonza added the feature New feature request label Sep 10, 2024
@sxyazi
Copy link
Owner

sxyazi commented Sep 14, 2024

Nice to have!

Anyone want to give this a go?

@sxyazi sxyazi added the good first issue Good for newcomers label Sep 14, 2024
@MrDwarf7
Copy link

Willing to have a crack at it, I've not been using Yazi all that long, but I presume this relates to the difference between exiting to the current directory Yazi is in (That the user has navigated to) vs. returning to where the shell spawned the process.

@DirkFi
Copy link
Contributor

DirkFi commented Sep 17, 2024

Willing to have a crack at it, I've not been using Yazi all that long, but I presume this relates to the difference between exiting to the current directory Yazi is in (That the user has navigated to) vs. returning to where the shell spawned the process.

I'm also trying to understand the issue. As to the problem you mentioned, it can be resolved by adding this to
Open Shell Here in your keymap.toml.

@MrDwarf7
Copy link

I have part content for a PR, though I need to do further testing and still somewhat unsure of what exactly OP is after.
Fairly sure my understanding is correct but would want confirmation.
@kockahonza - Anything that you can clarify on the feat. would be good please

@sxyazi sxyazi added the waiting on op Waiting for more information from the original poster label Sep 21, 2024
@sxyazi
Copy link
Owner

sxyazi commented Sep 21, 2024

If I understood correctly, OP means to add the --no-cwd-file option to the close command as well, as when the user closes the last tab, the close command will call the quit command:

self.quit((), tasks);

and at that point, we need to pass the --no-cwd-file option to the quit:

pub struct Opt {
no_cwd_file: bool,
}

Let me know if this is what you want! @kockahonza

@kockahonza
Copy link
Author

Hi everyone! Sorry for my absence I was offline on a trip for a while. But yes I was thinking of exactly what is described by @sxyazi . Essentially so that if the close command is used on the last tab and hence yazi is closed, by default the shell would be in the directory last opened by yazi (if configured for that), but if --no-cwd-file was used then it would go back to the directory where yazi was originally opened.

@github-actions github-actions bot removed the waiting on op Waiting for more information from the original poster label Sep 26, 2024
@sxyazi sxyazi mentioned this issue Oct 16, 2024
59 tasks
@sxyazi
Copy link
Owner

sxyazi commented Oct 16, 2024

Tracked by #51

@sxyazi sxyazi closed this as completed Oct 16, 2024
Copy link

I'm going to lock this issue because it has been closed for 30 days. ⏳
This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please file a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 16, 2024
@sxyazi
Copy link
Owner

sxyazi commented Jan 11, 2025

Done in #2185 by @igxlin 🎉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants