Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

$_ doesn't work #85

Closed
elementaryBot opened this issue Apr 26, 2017 · 8 comments · Fixed by #295
Closed

$_ doesn't work #85

elementaryBot opened this issue Apr 26, 2017 · 8 comments · Fixed by #295
Labels
Status: Confirmed Verified by someone other than the reporter

Comments

@elementaryBot
Copy link

elementaryBot commented Apr 26, 2017

$_ does not work in Terminal 0.4

Steps

  1. cd Downlaods
  2. cd $_

Error Message

bash: cd: __bp_preexec_invoke_exec: No such file or directory

Launchpad Details: #LP1628992 Jahdo Lee - 2016-09-29 16:21:55 +0000

@elementaryBot
Copy link
Author

Hello,

Can you clarify what is the expected behavior?

Launchpad Details: #LPC Zisu Andrei - 2016-09-29 19:07:08 +0000

@elementaryBot
Copy link
Author

$_ means the last used file path.

for example,

ls wordpress-4.6.zip && unzip -l $_

same as

ls wordpress-4.6.zip && unzip -l !#:1

Launchpad Details: #LPC Jahdo Lee - 2016-09-30 06:12:01 +0000

@elementaryBot
Copy link
Author

Apologies I have not asked this before, but can you give an example of a terminal in which this works?

Launchpad Details: #LPC Zisu Andrei - 2016-10-01 21:05:38 +0000

@elementaryBot
Copy link
Author

P.R.C National Day 10.1 - 10.7

it works in Gnome-terminal in Ubuntu 16.04, Terminal/iTerm2 in Mac OS X

Oh, it occurs to me that I use zsh, not bash, in there environments.

Launchpad Details: #LPC Jahdo Lee - 2016-10-10 05:54:07 +0000

@ghost
Copy link

ghost commented May 5, 2017

$_ is available in bash as documented here.

That said, I don't think this is a problem with the terminal app, but rather with the "bash-preexec" script included with elementary (/etc/bash-preexec). This also appears to be fixed in more recent versions of 'bash-preexec'.

@danirabbit danirabbit transferred this issue from elementary/terminal Dec 5, 2019
@danirabbit
Copy link
Member

danirabbit commented Dec 5, 2019

It looks like we added bash-prexec in a patch here: eb32017

So, moving to os-patches since that's where this file comes from. This patch probably needs to either be dropped completely or just rebased on the upstream version as implied by this tweet

@ryonakano ryonakano added the Status: Confirmed Verified by someone other than the reporter label Aug 14, 2024
@ryonakano
Copy link
Member

Linking the upstream issue here: rcaloras/bash-preexec#39

We can either cherry-pick the upstream fix or rebase on latest released upstream version, but I think the latter is better because our bash_preexec is old (0.2.1) and it might be impossible to simply cherry-pick the fix to our version.

@ryonakano ryonakano linked a pull request Aug 18, 2024 that will close this issue
2 tasks
@ryonakano
Copy link
Member

Closing as fixed in #295

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Status: Confirmed Verified by someone other than the reporter
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants