LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-20-2023, 04:25 AM   #1
coltfire
LQ Newbie
 
Registered: Jun 2010
Distribution: Slackware 15
Posts: 11

Rep: Reputation: 3
hitting tab after man makes bash unresponsive


Hi,
When I, accidentally, hit TAB after man command (empty argument),
the bash goes unresponsive, cpu 100% for couple of minutes.
I guess it happens because of bash completion,
but is there any solution to accidentally hitting TAB on empty argument after man?
 
Old 06-20-2023, 05:05 AM   #2
Loomx
Member
 
Registered: Sep 2012
Distribution: Slackware
Posts: 184

Rep: Reputation: Disabled
I used to have this happen too, very frustrating...

The master bash-completion file for `man' is /usr/share/bash-completion/completions/man
To edit it, copy it to /etc like this (as root):
Code:
cp /usr/share/bash-completion/completions/man /etc/bash_completion.d/man
Then edit line 69, which is the `else' branch of an `if' statement checking that there is an argument after the `man' command.
You want to change this:
Code:
manpath="${manpath//://*man$sect/ } ${manpath//://*cat$sect/ }"
to this:
Code:
return
Now if you push tab with an empty argument it just returns immediately.
 
Old 06-20-2023, 05:43 AM   #3
coltfire
LQ Newbie
 
Registered: Jun 2010
Distribution: Slackware 15
Posts: 11

Original Poster
Rep: Reputation: 3
Thanks!

Your solution helps with an issue
(needed to restart bash, so the edit comes to an effect)
 
Old 06-21-2023, 03:01 AM   #4
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,423

Rep: Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163
FYI

The latest release (2.11) is 3 years old...
I recompiled bash_completion based on the latest commit (0a2443e3 - 2 days ago)
Everything works as it should

Last edited by marav; 06-21-2023 at 03:02 AM.
 
Old 06-21-2023, 10:53 AM   #5
coltfire
LQ Newbie
 
Registered: Jun 2010
Distribution: Slackware 15
Posts: 11

Original Poster
Rep: Reputation: 3
Quote:
The latest release (2.11) is 3 years old...
I recompiled bash_completion based on the latest commit (0a2443e3 - 2 days ago)
Everything works as it should
Thanks, I will try to do the same
Did you installed it as a local slackbuild?
 
1 members found this post helpful.
Old 06-21-2023, 11:08 AM   #6
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,423

Rep: Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163
Quote:
Originally Posted by coltfire View Post
Thanks, I will try to do the same
Did you installed it as a local slackbuild?
I use this script (Thx PV) to catch the latest git version:
Code:
#!/bin/sh

URL=https://github.com/scop
PKGNAM=bash-completion

# Pull a stable branch + patches
BRANCH=${1:-master}

# Clear download area:
rm -rf ${PKGNAM}

# Clone repository:
git clone ${URL}/${PKGNAM}

# checkout $BRANCH:
( cd ${PKGNAM} 
  git checkout $BRANCH || exit 1
)

HEADISAT="$( cd ${PKGNAM} && git log -1 --format=%h )"
DATE="$( cd ${PKGNAM} && git log -1 --format=%cd --date=format:%Y%m%d )"
LONGDATE="$( cd ${PKGNAM} && git log -1 --format=%cd --date=format:%c )"

# Cleanup.  We're not packing up the whole git repo.
( cd ${PKGNAM} && find . -type d -name ".git*" -exec rm -rf {} \; 2> /dev/null )
mv ${PKGNAM} ${PKGNAM}-${DATE}_${HEADISAT}
tar cf ${PKGNAM}-${DATE}_${HEADISAT}.tar ${PKGNAM}-${DATE}_${HEADISAT}
plzip -9 -f ${PKGNAM}-${DATE}_${HEADISAT}.tar
rm -rf ${PKGNAM}-${DATE}_${HEADISAT}
touch -d "$LONGDATE" ${PKGNAM}-${DATE}_${HEADISAT}.tar.lz
echo
echo "${PKGNAM} branch $BRANCH with HEAD at $HEADISAT packaged as ${PKGNAM}-${DATE}_${HEADISAT}.tar.lz"
echo
And this modified SlackBuild
Code:
# Slackware build script for bash-completion
 
-VERSION=2.11
+VERSION=20230619_0a2443e3
 ARCH=noarch
 BUILD=${BUILD:-2}
 
@@ -49,7 +49,7 @@
 done
 
 # Fixup sh completion for us
-zcat $CWD/fixup-sh-script-completions.diff.gz | patch -p1 --verbose || exit 1
+#zcat $CWD/fixup-sh-script-completions.diff.gz | patch -p1 --verbose || exit 1
 
 autoreconf -vif
 
1 members found this post helpful.
Old 06-21-2023, 11:36 AM   #7
coltfire
LQ Newbie
 
Registered: Jun 2010
Distribution: Slackware 15
Posts: 11

Original Poster
Rep: Reputation: 3
Thank you!
Will try it out
 
  


Reply

Tags
man



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] VirtualBox 6.1.38 makes system unresponsive (Kernel 5.15.63) gargamel Slackware 10 10-17-2022 12:21 PM
Bash Question: How to get the pid of 2nd terminal tab in 1st terminal tab ? Lennard37 Programming 28 12-07-2021 04:34 PM
LXer: The first browser to introduce a second level in the tab bar for managing tab groups: Two-Level Tab LXer Syndicated Linux News 0 03-01-2021 05:50 AM
libinput makes devices unresponsive naikin Linux - Software 4 08-08-2016 03:17 PM
bash "tab tab" - how to turn off? nicflatterie Linux - General 2 04-04-2005 03:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration