Bug 217815

Summary: ifconfig wrap around line not indented
Product: Base System Reporter: joeb1
Component: binAssignee: freebsd-net (Nobody) <net>
Status: Closed Not Accepted    
Severity: Affects Many People CC: melifaro
Priority: ---    
Version: 11.0-RELEASE   
Hardware: Any   
OS: Any   

Description joeb1 2017-03-15 17:04:49 UTC
Some network devices have a long list of options and when ifconfig lists them    the line wraps around to position one instead of being indented.

An example follows.

/root >ifconfig -a
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=4019b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,VLA
N_HWTSO>
	ether d0:50:99:93:75:98
	inet 7x.14x.8x.7x netmask 0xfffffc00 broadcast 255.255.255.255 
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: Ethernet autoselect (100baseTX <full-duplex>)
	status: active
vge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=389b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST
,WOL_MCAST,WOL_MAGIC>
	ether 10:00:60:21:00:93
	inet 10.0.10.2 netmask 0xff000000 broadcast 10.255.255.255 
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: Ethernet autoselect (100baseTX <full-duplex>)
	status: active

Need to change ifconfig to check print line length to see if the content exceeds the max line size, and if so take the remaining content and print it on a new indented line so it looks nice.
Comment 1 Alexander V. Chernikov freebsd_committer freebsd_triage 2023-06-05 12:32:03 UTC
I agree it would be nice to see the indented options, when looking in the long-list capabilities in a small shell window.
Unfortunately, I don't see how it can be implemented in a compatible fashion. Tons of scripts assume ifconfig(8) has specific output format and splitting options flag into multiple lines would cause the breakage for some users.

Given I don't see any reasonable way forward, I'll probably have to close it in a ~week timeframe. Please do reply if you can think of any way that would improve the visual representation while preserving compatibility.
Comment 2 Alexander V. Chernikov freebsd_committer freebsd_triage 2023-06-13 06:47:56 UTC
I'm going to close this one. Please do reopen if you have an idea of representing the suggested change in a way compatible with the existing scripts.