Cut session info at 80 columns

Prevents a long "id" line from destroying the layout
unstable
James Lee 2012-04-05 11:07:42 -06:00
parent eb39b5f6aa
commit 2c992c976d
1 changed files with 7 additions and 1 deletions

View File

@ -416,7 +416,13 @@ class ReadableText
framework.sessions.each_sorted { |k|
session = framework.sessions[k]
row = [ session.sid.to_s, session.type.to_s, session.info.to_s, session.tunnel_to_s + " (#{session.session_host})" ]
sinfo = session.info.to_s
# Arbitrarily cut it at 80 columns
if sinfo.length > 80
sinfo = sinfo[0,77] + "..."
end
row = [ session.sid.to_s, session.type.to_s, sinfo, session.tunnel_to_s + " (#{session.session_host})" ]
if session.respond_to? :platform
row[1] += " " + session.platform
end