Bug#782169: mosh: bash_completion script does not complete hosts from known_hosts

2015-04-08 Thread Gabriel Filion
Package: mosh
Version: 1.2.4a-1+b2
Severity: normal
Tags: patch

Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?
   * What exactly did you do (or not do) that was effective (or
 ineffective)?
   * What was the outcome of this action?
   * What outcome did you expect instead?

*** End of the template - remove these template lines ***

Content-Type: text/plain; charset=us-ascii
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Gabriel Filion gabs...@lelutin.ca
To: Debian Bug Tracking System sub...@bugs.debian.org
Subject: mosh: script for bash_completion does not find hosts in known_hosts
Message-ID: 20150408195653.4718.63600.report...@boohn.lelutin.ca
X-Mailer: reportbug 6.6.3
Date: Wed, 08 Apr 2015 15:56:53 -0400

Package: mosh
Version: 1.2.4a-1+b2
Severity: normal
Tags: patch

Hello,

The script for bash_completion included in the mosh package does not complete
hosts from ssh's known_hosts. This is annoying since that's the most frequent
source of hostnames for machines to ssh to.

Also, according to the comment on the _known_hosts function in
/usr/share/bash-completion/bash_completion, the _known_hosts function is
deprecated and _known_hosts_all should be used instead. This latter function
needs a minimum of setup.

Here's a patch for the /etc/bash_completion.d/mosh file that implements lookup
for known_hosts:

--8
$ diff -burN /etc/bash_completion.d/mosh{.old,}
--- /etc/bash_completion.d/mosh.old 2015-04-08 15:54:11.122373833 -0400
+++ /etc/bash_completion.d/mosh 2015-04-08 15:54:15.414322372 -0400
@@ -1 +1,9 @@
-complete -F _known_hosts mosh
+_mosh () {
+local cur prev
+
+_init_completion || return
+
+_known_hosts_real -a $cur
+}
+
+complete -F _mosh mosh
-8-

Note that this does not take into account any arguments to the mosh executable,
so it's probably not the best possible formulation for a bash_completion
script, but it fixes the lack of known_hosts completion and can be built upon
for adding the other options.

-- System Information:
Debian Release: 8.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (50, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_CA.utf8, LC_CTYPE=en_CA.utf8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_CA.utf8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages mosh depends on:
ii  libc6   2.19-17
ii  libgcc1 1:4.9.2-10
ii  libprotobuf92.6.1-1
ii  libssl1.0.0 1.0.1k-3
ii  libstdc++6  4.9.2-10
ii  libtinfo5   5.9+20140913-1+b1
ii  libutempter01.1.5-4
ii  openssh-client  1:6.7p1-5
ii  zlib1g  1:1.2.8.dfsg-2+b1

mosh recommends no packages.

mosh suggests no packages.

-- Configuration Files:
/etc/bash_completion.d/mosh changed [not included]

-- no debconf information

-- System Information:
Debian Release: 8.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (50, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_CA.utf8, LC_CTYPE=en_CA.utf8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_CA.utf8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages mosh depends on:
ii  libc6   2.19-17
ii  libgcc1 1:4.9.2-10
ii  libprotobuf92.6.1-1
ii  libssl1.0.0 1.0.1k-3
ii  libstdc++6  4.9.2-10
ii  libtinfo5   5.9+20140913-1+b1
ii  libutempter01.1.5-4
ii  openssh-client  1:6.7p1-5
ii  zlib1g  1:1.2.8.dfsg-2+b1

mosh recommends no packages.

mosh suggests no packages.

-- Configuration Files:
/etc/bash_completion.d/mosh changed [not included]

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#782169: mosh: bash_completion script does not complete hosts from known_hosts

2015-04-08 Thread Gabriel Filion
On 08/04/15 04:28 PM, Gabriel Filion wrote:
 Package: mosh
 Version: 1.2.4a-1+b2
 Severity: normal
 Tags: patch
 
 Dear Maintainer,
 [...]

argh, sorry about that content duplication. I was having issues with
configuring reportbug correctly so I saved the former report trial as a
file. and I'm still trying to get a hang of all the (many!) quirks of
reportbug.. seems like the --body-file option didn't do what I expected.


Also, I've included the command line used for diffing, which does make
the cut-here part of my original message not applicable as-is: you
need to remove the first line. my objective with that was to ensure that
you know what the formatting of the patch corresponds to.

-- 
Gabriel Filion





signature.asc
Description: OpenPGP digital signature