mirror of
				https://github.com/go-delve/delve.git
				synced 2025-10-31 18:57:18 +08:00 
			
		
		
		
	terminal: config -list should print strings in quotes (#2605)
Commit 8e91d3b0b added a number of configuration options to control the colors of sytnax highlighting, unfortunately 'config -list' will print all of those to stdout without quoting them, resulting in the color of the last one being applied to all subsequent text. Change 'config -list' to print strings in quotes so that we don't accidentally send escape sequences to the terminal.
This commit is contained in:
		 Alessandro Arzilli
					Alessandro Arzilli
				
			
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			 GitHub
						GitHub
					
				
			
						parent
						
							7cdf48605b
						
					
				
				
					commit
					3d6bbbe92a
				
			| @ -81,13 +81,16 @@ func configureList(t *Term) error { | |||||||
| 			continue | 			continue | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		if field.Kind() == reflect.Ptr { | 		switch field.Kind() { | ||||||
|  | 		case reflect.Ptr: | ||||||
| 			if !field.IsNil() { | 			if !field.IsNil() { | ||||||
| 				fmt.Fprintf(w, "%s\t%v\n", fieldName, field.Elem()) | 				fmt.Fprintf(w, "%s\t%v\n", fieldName, field.Elem()) | ||||||
| 			} else { | 			} else { | ||||||
| 				fmt.Fprintf(w, "%s\t<not defined>\n", fieldName) | 				fmt.Fprintf(w, "%s\t<not defined>\n", fieldName) | ||||||
| 			} | 			} | ||||||
| 		} else { | 		case reflect.String: | ||||||
|  | 			fmt.Fprintf(w, "%s\t%q\n", fieldName, field) | ||||||
|  | 		default: | ||||||
| 			fmt.Fprintf(w, "%s\t%v\n", fieldName, field) | 			fmt.Fprintf(w, "%s\t%v\n", fieldName, field) | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user