GithubHelp home page GithubHelp logo

failed to start based on TERM about termshark HOT 14 CLOSED

gcla avatar gcla commented on June 6, 2024
failed to start based on TERM

from termshark.

Comments (14)

gcla avatar gcla commented on June 6, 2024 1

I asked here:

gdamore/tcell#279

from termshark.

pocc avatar pocc commented on June 6, 2024

Please post tshark -v and any other relevant facts about your system.

from termshark.

szuecs avatar szuecs commented on June 6, 2024

Relevant facts: I use screen

% tshark -v
TShark (Wireshark) 2.6.6 (Git v2.6.6 packaged as 2.6.6-1~ubuntu18.04.0)

Copyright 1998-2019 Gerald Combs <[email protected]> and contributors.
License GPLv2+: GNU GPL version 2 or later <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiled (64-bit) with libpcap, with POSIX capabilities (Linux), with libnl 3,
with GLib 2.56.2, with zlib 1.2.11, with SMI 0.4.8, with c-ares 1.14.0, with Lua
5.2.4, with GnuTLS 3.5.18, with Gcrypt 1.8.1, with MIT Kerberos, with MaxMind DB
resolver, with nghttp2 1.30.0, with LZ4, with Snappy, with libxml2 2.9.4.

Running on Linux 4.15.0-47-generic, with Intel(R) Core(TM) i5-5300U CPU @
2.30GHz (with SSE4.2), with 15740 MB of physical memory, with locale
en_US.UTF-8, with libpcap version 1.8.1, with GnuTLS 3.5.18, with Gcrypt 1.8.1,
with zlib 1.2.11, binary plugins supported (13 loaded).

Built using gcc 7.3.0.

The same problem I had with some other Go tool, I don't remember which one it was. They fixed it by adding something to $TERM check if I recall correctly.

from termshark.

pocc avatar pocc commented on June 6, 2024
  • Can you check whether updating tshark/Wireshark to v3.0.0 affects this problem?
  • It's possible that there are builtin bash assumptions that shouldn't be there. If you have bash installed, can you check whether using that shell ameliorates this issue?
  • Do you see this problem using a different terminal, not using screen?

from termshark.

pocc avatar pocc commented on June 6, 2024

@szuecs Do you have any updates? Were you able to find the $TERMINAL_VAR that fixed?

from termshark.

pocc avatar pocc commented on June 6, 2024

Noting this may be the same issue as #7.

from termshark.

szuecs avatar szuecs commented on June 6, 2024

Sorry @pocc I did not see notifications.
It only happens if I use screen.
I did not tested a different tshark version.
As in #7 , I also use xfce4-terminal. So it might be a related problem.

The funny thing is that TERM=xterm-256color termshark starts, but does not show the cursor as in #7, too. Without screen (but with xfce4-terminal) everything works with cursor. I also had a problem in some other project with the TERM settings and a Go project. Maybe you use the same library and the problem is there.

from termshark.

gcla avatar gcla commented on June 6, 2024

Hi - I found an explanation for this TERM variable setting here in the screen manual:

https://www.gnu.org/software/screen/manual/screen.html#Window-Termcap

Here's a quick summary:

When screen tries to figure out a terminal name for itself, it first looks for an entry named screen.term, where term is the contents of your $TERM variable. If no such entry exists, screen tries ‘screen’ (or ‘screen-w’, if the terminal is wide (132 cols or more)). If even this entry cannot be found, ‘vt100’ is used as a substitute.

The idea is that if you have a terminal which doesn’t support an important feature (e.g. delete char or clear to EOS) you can build a new termcap/terminfo entry for screen (named ‘screen.dumbterm’) in which this capability has been disabled. If this entry is installed on your machines you are able to do a rlogin and still keep the correct termcap/terminfo entry. The terminal name is put in the $TERM variable of all new windows. screen also sets the $TERMCAP variable reflecting the capabilities of the virtual terminal emulated. Furthermore, the variable $WINDOW is set to the window number of each window.

I can reproduce this problem running screen on Ubuntu 18.10. In my shell, TERM=xterm-256color and when I start screen, TERM=screen.xterm-256color. Running screen with strace, I found a terminfo file at /lib/terminfo/s/screen.xterm-256color.

The reason termshark returns an error is that tcell has a compiled-in terminfo database, which is generated by running a small program that converts terminfo files into Go source code - for example

https://github.com/gdamore/tcell/blob/master/terminfo/term_xterm_256color.go

and that database does not contain an entry for screen.xterm-256color.

Having written all that, I'm not sure why tcell doesn't try to compile a terminfo file on-the-fly, on the machine on which it's running.

Setting TERM is fine, or I believe something like this in your ~/.screenrc will do it for new screen sessions

term screen-256color

from termshark.

szuecs avatar szuecs commented on June 6, 2024

@gcla thanks for your investigation!
Do you want to file a bug to tcell or should I follow up?

from termshark.

gcla avatar gcla commented on June 6, 2024

Hi @szuecs - no prob, I'll add a tcell issue to figure this out.

from termshark.

gcla avatar gcla commented on June 6, 2024

Hi @szuecs - @gdamore updated tcell so that it now builds a terminal description on-the-fly, if one is not found in tcell's database. I've updated termshark to depend on the latest tcell. This seems to fix this issue for me. Now if I launch screen, then run termshark, it runs correctly. If you want to try it out, here are build instructions:

git clone https://github.com/gcla/termshark
cd termshark
export GO111MODULE=on
go install ./...

Then termshark will be in ~/go/bin. Let me know!

from termshark.

szuecs avatar szuecs commented on June 6, 2024

termshark starts successfully, now.
I have some problems seeing packets, but I will check it tomorrow again

from termshark.

gcla avatar gcla commented on June 6, 2024

ok, thank you

from termshark.

szuecs avatar szuecs commented on June 6, 2024

The problem was that I ran it as root and not as user. If I run as normal user it works.
Thanks again for solving this issue!

from termshark.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.