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

Really escape zsh history #3124

Closed
mc-butler opened this issue Dec 11, 2013 · 10 comments
Closed

Really escape zsh history #3124

mc-butler opened this issue Dec 11, 2013 · 10 comments
Assignees
Labels
area: core Issues not related to a specific subsystem prio: medium Has the potential to affect progress
Milestone

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/3124
Reporter z0rc (z0rc3r@….com)
Mentions gotar@….pl

The [ cd "`printf "%b" ...] stuff doesn't completely escape zsh history. There is one edge case. The use case is following.

  • set shell to zsh and add "setopt HIST_IGNORE_SPACE" to ~/.zshrc
  • mc
  • navigate to any directory
  • ctrl+o
  • hit ↑ (go back in history button)
  • observe that cd "`printf "%b" ... clutter

Here is citation from zsh documentation about HIST_IGNORE_SPACE:

Note that the command lingers in the internal history until the next command is entered before it vanishes, allowing you to briefly reuse or edit the line. If you want to make it vanish right away without entering another command, type a space and press return.

There is no option to change this behaviour. Can mc adopt recommended action to execute " " command after cd?

Note

Original attachments:

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Dec 12, 2013 at 4:30 UTC (comment 1)

Related to #3063.

@mc-butler
Copy link
Author

Changed by z0rc (z0rc3r@….com) on Dec 16, 2013 at 20:15 UTC

@mc-butler
Copy link
Author

Changed by z0rc (z0rc3r@….com) on Dec 16, 2013 at 20:21 UTC (comment 2)

  • Keywords set to review
  • Milestone changed from Future Releases to 4.8.12

Here is a quick fix for this issue. But I'd like to get a review, as I haven't dig into mc's source code too much and this might be done more effectively or in some other way.

As a side note, I'd really like to see this fix and one from #3125 to get into mc before 4.8.12. So these fixes hopefully will be available in next Ubuntu LTS and Debian stable.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Dec 24, 2013 at 6:23 UTC (comment 2.3)

  • Status changed from new to accepted
  • Votes set to andrew_b
  • Keywords review deleted
  • Branch state changed from no branch to on review
  • Owner set to andrew_b

Replying to z0rc:

Here is a quick fix for this issue.

Looks correct. Thanks!

Branch: 3124_zsh_escape_history
[2fd0ec82a310aab76ee1a7044d65d93717e5011c]

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Jan 4, 2014 at 9:56 UTC (comment 4)

  • Branch state changed from on review to approved
  • Votes changed from andrew_b to andrew_b slavazanko

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jan 4, 2014 at 12:24 UTC (comment 5)

  • Votes changed from andrew_b slavazanko to committed-master
  • Branch state changed from approved to merged
  • Status changed from accepted to testing
  • Resolution set to fixed

Merged to master: [72544ce].

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jan 4, 2014 at 12:26 UTC (comment 6)

  • Status changed from testing to closed

@mc-butler
Copy link
Author

Changed by drookie (eugene@….in) on Jan 30, 2014 at 7:22 UTC (comment 7)

I patched 4.8.11 from FreeBSD ports (since no 4.8.12 yet), this works great, except that last cd %b command is still in the shell history (while other aren't, au contraire without the patch).

Do I get this alone ?

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jan 30, 2014 at 7:45 UTC (comment 7.8)

Replying to drookie:

I patched 4.8.11 from FreeBSD ports (since no 4.8.12 yet), this works great, except that last cd %b command is still in the shell history

In the zsh shell history?

@mc-butler
Copy link
Author

Changed by gotar (gotar@….pl) on Apr 4, 2014 at 8:18 UTC (comment 9)

  • Cc set to gotar@….pl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: core Issues not related to a specific subsystem prio: medium Has the potential to affect progress
Development

No branches or pull requests

2 participants